GenVM release #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: GenVM release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| type: choice | |
| required: false | |
| description: "Version bump type (ignored if version_override is set)" | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| default: patch | |
| version_override: | |
| type: string | |
| required: false | |
| description: "Override version (e.g., v1.2.3). If set, bump is ignored" | |
| defaults: | |
| run: | |
| shell: bash -x {0} | |
| permissions: | |
| actions: read | |
| contents: read | |
| env: | |
| GCS_BUCKET: "gh-af" | |
| jobs: | |
| gen-tag: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.determine-version.outputs.new_version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-ecosystem/action-get-latest-tag@v1 | |
| id: get-latest-tag | |
| if: github.event.inputs.version_override == '' | |
| - uses: actions-ecosystem/action-bump-semver@v1 | |
| id: bump-semver | |
| if: github.event.inputs.version_override == '' | |
| with: | |
| current_version: ${{ steps.get-latest-tag.outputs.tag }} | |
| level: ${{ github.event.inputs.bump }} | |
| - name: Determine final version | |
| id: determine-version | |
| run: | | |
| if [ -n "${{ github.event.inputs.version_override }}" ]; then | |
| echo "Using override version: ${{ github.event.inputs.version_override }}" | |
| echo "new_version=${{ github.event.inputs.version_override }}" >> $GITHUB_OUTPUT | |
| else | |
| echo "Using bumped version: ${{ steps.bump-semver.outputs.new_version }}" | |
| echo "new_version=${{ steps.bump-semver.outputs.new_version }}" >> $GITHUB_OUTPUT | |
| fi | |
| echo "new version will be: ${{ steps.determine-version.outputs.new_version }}" | |
| build-universal-manifest: | |
| needs: [gen-tag] | |
| uses: ./.github/workflows/incl_build_trg.yaml | |
| with: | |
| target: universal-manifest | |
| executor_version: ${{ needs.gen-tag.outputs.tag }} | |
| secrets: | |
| GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
| build-universal: | |
| needs: [gen-tag] | |
| uses: ./.github/workflows/incl_build_trg.yaml | |
| with: | |
| target: universal | |
| executor_version: ${{ needs.gen-tag.outputs.tag }} | |
| secrets: | |
| GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
| build-linux-amd64: | |
| needs: | |
| - gen-tag | |
| - build-universal-manifest | |
| uses: ./.github/workflows/incl_build_trg.yaml | |
| with: | |
| target: amd64-linux | |
| secondary_target: amd64-linux-executor | |
| executor_version: ${{ needs.gen-tag.outputs.tag }} | |
| bundle_extra: ${{ needs.build-universal-manifest.outputs.artifact_url }} | |
| secrets: | |
| GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
| build-linux-arm64: | |
| needs: | |
| - gen-tag | |
| - build-universal-manifest | |
| uses: ./.github/workflows/incl_build_trg.yaml | |
| with: | |
| target: arm64-linux | |
| secondary_target: arm64-linux-executor | |
| executor_version: ${{ needs.gen-tag.outputs.tag }} | |
| bundle_extra: ${{ needs.build-universal-manifest.outputs.artifact_url }} | |
| secrets: | |
| GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
| build-macos-arm64: | |
| needs: | |
| - gen-tag | |
| - build-universal-manifest | |
| uses: ./.github/workflows/incl_build_trg.yaml | |
| with: | |
| target: arm64-macos | |
| secondary_target: arm64-macos-executor | |
| executor_version: ${{ needs.gen-tag.outputs.tag }} | |
| bundle_extra: ${{ needs.build-universal-manifest.outputs.artifact_url }} | |
| secrets: | |
| GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
| test-linux-arm64: | |
| needs: | |
| - build-linux-arm64 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Get source | |
| uses: ./.github/actions/get-src | |
| with: | |
| load_submodules: "false" | |
| with_nix: "true" | |
| - name: Download artifact | |
| run: | | |
| mkdir -p build/out && \ | |
| pushd build/out && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-arm64.tar.xz ${{ needs.build-linux-arm64.outputs.artifact_url }} && \ | |
| tar -xf genvm-linux-arm64.tar.xz --no-same-owner && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-arm64-executor.tar.xz ${{ needs.build-linux-arm64.outputs.secondary_artifact_url }} && \ | |
| tar -xf genvm-linux-arm64-executor.tar.xz --no-same-owner && \ | |
| popd && \ | |
| true | |
| - name: Run post-install | |
| run: | | |
| ./build/out/bin/post-install.py \ | |
| --error-on-missing-executor=false \ | |
| --default-download=false || true | |
| nix develop .#check-qemu --command bash -c 'qemu-aarch64 ./build/out/bin/genvm-modules --version' | |
| test-linux-amd64: | |
| needs: | |
| - build-linux-amd64 | |
| - build-universal | |
| - gen-tag | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Get source | |
| uses: ./.github/actions/get-src | |
| with: | |
| load_submodules: "false" | |
| with_nix: "true" | |
| - name: Download artifact | |
| run: | | |
| mkdir -p build/out && \ | |
| pushd build/out && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-amd64.tar.xz ${{ needs.build-linux-amd64.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-universal.tar.xz ${{ needs.build-universal.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-amd64-executor.tar.xz ${{ needs.build-linux-amd64.outputs.secondary_artifact_url }} && \ | |
| tar -xf genvm-linux-amd64.tar.xz --no-same-owner && \ | |
| tar -xf genvm-universal.tar.xz --no-same-owner && \ | |
| tar -xf genvm-linux-amd64-executor.tar.xz --no-same-owner && \ | |
| popd && \ | |
| true | |
| - name: Run post-install | |
| run: | | |
| ./build/out/bin/post-install.py \ | |
| --error-on-missing-executor=false \ | |
| --default-download=false | |
| - name: Run stable tests | |
| run: | | |
| nix develop .#mock-tests --command ya-test-runner --filter-tag "$(cat tests/presets/release.txt)" run --genvm-reroute-to ${{ needs.gen-tag.outputs.tag }} | |
| test-macos-arm64: | |
| needs: | |
| - build-macos-arm64 | |
| - build-universal | |
| - gen-tag | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - name: Get source | |
| uses: ./.github/actions/get-src | |
| with: | |
| load_submodules: "false" | |
| with_nix: "false" | |
| - name: Download artifact | |
| run: | | |
| mkdir -p build/out && \ | |
| pushd build/out && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-macos-arm64.tar.xz ${{ needs.build-macos-arm64.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-universal.tar.xz ${{ needs.build-universal.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-macos-arm64-executor.tar.xz ${{ needs.build-macos-arm64.outputs.secondary_artifact_url }} && \ | |
| tar -xf genvm-macos-arm64.tar.xz --no-same-owner && \ | |
| tar -xf genvm-universal.tar.xz --no-same-owner && \ | |
| tar -xf genvm-macos-arm64-executor.tar.xz --no-same-owner && \ | |
| popd && \ | |
| true | |
| - name: Get wabt | |
| run: | | |
| brew install wabt | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Run post-install | |
| run: | | |
| ./build/out/bin/post-install.py \ | |
| --error-on-missing-executor=false \ | |
| --default-download=false | |
| - name: Run stable tests | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| pip install ./tools/ya-test-runner | |
| ya-test-runner --filter-tag "$(cat tests/presets/release.txt)" run --genvm-reroute-to ${{ needs.gen-tag.outputs.tag }} | |
| release-publish: | |
| needs: | |
| - gen-tag | |
| - build-linux-amd64 | |
| - build-linux-arm64 | |
| - build-macos-arm64 | |
| - build-universal | |
| - test-linux-amd64 | |
| - test-linux-arm64 | |
| - test-macos-arm64 | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # Needed for creating releases | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| - run: sudo apt-get install -y python3-poetry | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: poetry | |
| - name: Publish to test pypi | |
| run: | | |
| python3.12 -m pip install poetry && \ | |
| pushd runners/genlayer-py-std && \ | |
| perl -i -pe 's/version = "v0.0.1"/version = "${{ needs.gen-tag.outputs.tag }}"/' pyproject.toml && \ | |
| poetry build && \ | |
| poetry config repositories.test-pypi https://test.pypi.org/legacy/ && \ | |
| poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_TOKEN }} && \ | |
| poetry publish -r test-pypi && \ | |
| popd | |
| - run: | | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-universal.tar.xz ${{ needs.build-universal.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-amd64.tar.xz ${{ needs.build-linux-amd64.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-arm64.tar.xz ${{ needs.build-linux-arm64.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-macos-arm64.tar.xz ${{ needs.build-macos-arm64.outputs.artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-amd64-executor.tar.xz ${{ needs.build-linux-amd64.outputs.secondary_artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-linux-arm64-executor.tar.xz ${{ needs.build-linux-arm64.outputs.secondary_artifact_url }} && \ | |
| curl -L --fail-with-body -H 'Accept: application/octet-stream' -o genvm-macos-arm64-executor.tar.xz ${{ needs.build-macos-arm64.outputs.secondary_artifact_url }} && \ | |
| true | |
| - run: | | |
| git tag ${{ needs.gen-tag.outputs.tag }} && \ | |
| git push origin ${{ needs.gen-tag.outputs.tag }} | |
| - name: Generate release notes | |
| id: release_notes | |
| run: | | |
| prev_tag=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "") | |
| new_tag="${{ needs.gen-tag.outputs.tag }}" | |
| if [ -n "$prev_tag" ]; then | |
| python3 support/ci/make-relase-notes.py "${prev_tag}..${new_tag}" > release-notes.md | |
| else | |
| echo "Initial release" > release-notes.md | |
| fi | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| genvm-universal.tar.xz | |
| genvm-linux-amd64.tar.xz | |
| genvm-linux-arm64.tar.xz | |
| genvm-macos-arm64.tar.xz | |
| genvm-linux-amd64-executor.tar.xz | |
| genvm-linux-arm64-executor.tar.xz | |
| genvm-macos-arm64-executor.tar.xz | |
| name: Release ${{ needs.gen-tag.outputs.tag }} | |
| tag_name: ${{ needs.gen-tag.outputs.tag }} | |
| body_path: release-notes.md | |
| draft: false | |
| prerelease: false | |
| deploy-docs: | |
| needs: | |
| - release-publish | |
| - gen-tag | |
| uses: ./.github/workflows/incl_docs.yml | |
| with: | |
| version: ${{ needs.gen-tag.outputs.tag }} | |
| secrets: | |
| DEPLOY_TOKEN: ${{ secrets.SDK_GENLAYER_COM_RW }} |