Skip to content

Commit

Permalink
TODO: GHA...
Browse files Browse the repository at this point in the history
  • Loading branch information
szatanjl committed Oct 8, 2024
1 parent b37d173 commit 0dd6a08
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 33 deletions.
70 changes: 39 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
tags:
- v*
- pre-rel-*
workflow_dispatch:

env:
self-test-img_tag: v0.1.4
Expand Down Expand Up @@ -51,20 +52,26 @@ jobs:
steps:
- name: Install Musl
run: sudo apt-get install -y musl-tools musl autoconf gperf libtool automake
- name: Install Rust ${{ env.rust_stable }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_stable }}
target: x86_64-unknown-linux-musl
override: true
- uses: actions/checkout@v1
- name: Make
run: |
musl-gcc -v
git submodule init
git submodule update
cd runtime/init-container
cd rinit
make
- uses: actions/upload-artifact@v4
with:
name: init-container
path: |
runtime/init-container/initramfs.cpio.gz
runtime/init-container/vmlinuz-virt
rinit/initramfs.cpio.gz
rinit/vmlinuz-virt
build:
name: Build Release
Expand All @@ -81,10 +88,10 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: init-container
path: runtime/init-container/
path: rinit
- run: |
ls -R
test -f runtime/init-container/initramfs.cpio.gz
test -f rinit/initramfs.cpio.gz
- name: Download self-test image
uses: robinraju/[email protected]
with:
Expand Down Expand Up @@ -139,23 +146,23 @@ jobs:
cp runtime/conf/ya-runtime-vm.json "$TARGET_DIR/"
cp -r runtime/poc/runtime "$TARGET_DIR/ya-runtime-vm/"
cp "runtime/image/self-test.gvmi" "$TARGET_DIR/ya-runtime-vm/runtime/"
cp "runtime/init-container/initramfs.cpio.gz" "$TARGET_DIR/ya-runtime-vm/runtime/"
cp "runtime/init-container/vmlinuz-virt" "$TARGET_DIR/ya-runtime-vm/runtime/"
cp "rinit/initramfs.cpio.gz" "$TARGET_DIR/ya-runtime-vm/runtime/"
cp "rinit/vmlinuz-virt" "$TARGET_DIR/ya-runtime-vm/runtime/"
(cd releases && tar czvf "ya-runtime-vm-${OS_NAME}-${TAG_NAME}.tar.gz" "ya-runtime-vm-${OS_NAME}-${TAG_NAME}")
echo "::set-output name=artifact::ya-runtime-vm-${OS_NAME}-${TAG_NAME}.tar.gz"
echo "::set-output name=media::application/tar+gzip"
- name: Upload
run: echo todo upload ${{ steps.pack.outputs.artifact }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_upload_url.outputs.result }}
asset_path: ./releases/${{ steps.pack.outputs.artifact }}
asset_name: ${{ steps.pack.outputs.artifact }}
asset_content_type: ${{ steps.pack.outputs.media }}
#- name: Upload
# run: echo todo upload ${{ steps.pack.outputs.artifact }}
#- name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.release_upload_url.outputs.result }}
# asset_path: ./releases/${{ steps.pack.outputs.artifact }}
# asset_name: ${{ steps.pack.outputs.artifact }}
# asset_content_type: ${{ steps.pack.outputs.media }}
build-deb:
name: Build Deb
needs:
Expand Down Expand Up @@ -185,9 +192,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: init-container
path: runtime/init-container/
path: rinit
- run: |
test -f runtime/init-container/initramfs.cpio.gz
test -f rinit/initramfs.cpio.gz
- name: Download self-test image
uses: robinraju/[email protected]
with:
Expand All @@ -204,6 +211,7 @@ jobs:
GITHUB_REF: ${{ github.ref }}
run: |
TAG_NAME="${GITHUB_REF##*/}"
TAG_NAME=v1.0.0
TAGV_NAME="${TAG_NAME#pre-rel-}"
VERSION=${TAGV_NAME#v}
echo "::set-output name=tagv::${TAG_NAME}"
Expand All @@ -214,13 +222,13 @@ jobs:
debVersion: ${{ steps.version.outputs.version }}
pkgName: ya-runtime-vm
subdir: runtime
- name: Upload Release Deb
id: upload-release-asset-core
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_upload_url.outputs.result }}
asset_path: ${{ steps.deb.outputs.deb }}
asset_name: ya-runtime-vm_${{ steps.version.outputs.tagv }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package
#- name: Upload Release Deb
# id: upload-release-asset-core
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.release_upload_url.outputs.result }}
# asset_path: ${{ steps.deb.outputs.deb }}
# asset_name: ya-runtime-vm_${{ steps.version.outputs.tagv }}_amd64.deb
# asset_content_type: application/vnd.debian.binary-package
4 changes: 2 additions & 2 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ assets = [
],

[
"init-container/initramfs.cpio.gz",
"../rinit/initramfs.cpio.gz",
"usr/lib/yagna/plugins/ya-runtime-vm/runtime/",
"644",
],
[
"init-container/vmlinuz-virt",
"../rinit/vmlinuz-virt",
"usr/lib/yagna/plugins/ya-runtime-vm/runtime/",
"644",
],
Expand Down

0 comments on commit 0dd6a08

Please sign in to comment.