Release #7
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_tag: | |
| description: "Release tag, e.g. v0.1.0" | |
| required: true | |
| type: string | |
| pull_request: | |
| env: | |
| ZIG_VERSION: "0.16.0" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-bundle: | |
| name: Build package bundle | |
| runs-on: ubuntu-latest | |
| outputs: | |
| bundle_filename: ${{ steps.bundle.outputs.bundle_filename }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Zig | |
| uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # 2.2.1 | |
| with: | |
| version: ${{ env.ZIG_VERSION }} | |
| use-cache: false | |
| - name: Install Roc | |
| uses: roc-lang/setup-roc@66d1ae2def87ec77b8670e9ac09c418df2f18c86 | |
| with: | |
| # Installs the latest nightly from https://github.com/roc-lang/nightlies | |
| version: nightly-new-compiler | |
| - name: Check format and package | |
| run: | | |
| roc fmt --check package examples | |
| roc check package/main.roc | |
| roc test package/main.roc | |
| - name: Bundle package | |
| id: bundle | |
| run: | | |
| BUNDLE_OUTPUT=$(scripts/bundle.sh --output-dir dist 2>&1) | |
| echo "$BUNDLE_OUTPUT" | |
| BUNDLE_PATH=$(echo "$BUNDLE_OUTPUT" | grep "^Created:" | awk '{print $2}') | |
| BUNDLE_FILENAME=$(basename "$BUNDLE_PATH") | |
| if [ -z "$BUNDLE_FILENAME" ]; then | |
| echo "Error: could not extract bundle filename from roc bundle output" | |
| exit 1 | |
| fi | |
| echo "bundle_filename=$BUNDLE_FILENAME" >> "$GITHUB_OUTPUT" | |
| - name: Upload package bundle artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-bundle | |
| path: dist/${{ steps.bundle.outputs.bundle_filename }} | |
| retention-days: 30 | |
| test-bundle: | |
| name: Test package bundle (${{ matrix.os }}) | |
| needs: build-bundle | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-15-intel | |
| - windows-2025 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Zig | |
| uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # 2.2.1 | |
| with: | |
| version: ${{ env.ZIG_VERSION }} | |
| use-cache: false | |
| - name: Install Roc | |
| uses: roc-lang/setup-roc@66d1ae2def87ec77b8670e9ac09c418df2f18c86 | |
| with: | |
| # Installs the latest nightly from https://github.com/roc-lang/nightlies | |
| version: nightly-new-compiler | |
| - name: Download package bundle artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: package-bundle | |
| path: dist | |
| - name: Test examples against downloaded bundle | |
| run: python3 ci/test_bundle_examples.py --bundle-path "dist/${{ needs.build-bundle.outputs.bundle_filename }}" | |
| create-release: | |
| name: Create GitHub release | |
| needs: | |
| - build-bundle | |
| - test-bundle | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' | |
| permissions: | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download package bundle artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: package-bundle | |
| path: dist | |
| - name: Install Roc | |
| uses: roc-lang/setup-roc@66d1ae2def87ec77b8670e9ac09c418df2f18c86 | |
| with: | |
| # Installs the latest nightly from https://github.com/roc-lang/nightlies | |
| version: nightly-new-compiler | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| BUNDLE_FILE="dist/${{ needs.build-bundle.outputs.bundle_filename }}" | |
| ROC_VERSION=$(roc version) | |
| gh release create "${{ github.event.inputs.release_tag }}" \ | |
| "$BUNDLE_FILE" \ | |
| --title "${{ github.event.inputs.release_tag }}" \ | |
| --generate-notes \ | |
| --notes "Path package bundle built with Roc $ROC_VERSION." |