Merge branch 'main' into docs/signing-policy-d218 #36
Workflow file for this run
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
| # This workflow is managed by gh actions-lock. | ||
| # SPDX-License-Identifier: MPL-2.0 | ||
| # This workflow is managed by gh actions-lock. | ||
| # This workflow is managed by gh actions-lock. | ||
| name: Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to release' | ||
| required: true | ||
| permissions: | ||
| contents: write | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| jobs: | ||
| build-linux: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| matrix: | ||
| target: | ||
| - x86_64-unknown-linux-gnu | ||
| - x86_64-unknown-linux-musl | ||
| - aarch64-unknown-linux-gnu | ||
| - aarch64-unknown-linux-musl | ||
| - riscv64gc-unknown-linux-gnu | ||
| steps: | ||
| - uses: actions/checkout@v7.0.1 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: (was misnamed dtolnay/rust-action) | ||
| with: | ||
| targets: ${{ matrix.target }} | ||
| - name: Install cross | ||
| run: cargo install cross --git https://github.com/cross-rs/cross | ||
| - name: Build | ||
| run: cross build --release --target ${{ matrix.target }} | ||
| - name: Package | ||
| run: | | ||
| mkdir -p release | ||
| cp target/${{ matrix.target }}/release/bet-cli release/ | ||
| cp README.adoc LICENSE.txt CHANGELOG.md release/ | ||
| cd release | ||
| tar -czvf betlang-${{ github.ref_name }}-${{ matrix.target }}.tar.gz * | ||
| - uses: actions/upload-artifact@v7.0.1 | ||
| with: | ||
| name: betlang-${{ matrix.target }} | ||
| path: release/*.tar.gz | ||
| build-macos: | ||
| runs-on: macos-latest | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| matrix: | ||
| target: | ||
| - x86_64-apple-darwin | ||
| - aarch64-apple-darwin | ||
| steps: | ||
| - uses: actions/checkout@v7.0.1 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.target }} | ||
| - name: Build | ||
| run: cargo build --release --target ${{ matrix.target }} | ||
| - name: Package | ||
| run: | | ||
| mkdir -p release | ||
| cp target/${{ matrix.target }}/release/bet-cli release/ | ||
| cp README.adoc LICENSE.txt CHANGELOG.md release/ | ||
| cd release | ||
| tar -czvf betlang-${{ github.ref_name }}-${{ matrix.target }}.tar.gz * | ||
| - uses: actions/upload-artifact@v7.0.1 | ||
| with: | ||
| name: betlang-${{ matrix.target }} | ||
| path: release/*.tar.gz | ||
| build-windows: | ||
| runs-on: windows-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v7.0.1 | ||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| - name: Build | ||
| run: cargo build --release | ||
| - name: Package | ||
| shell: bash | ||
| run: | | ||
| mkdir -p release | ||
| cp target/release/bet-cli.exe release/ | ||
| cp README.adoc LICENSE.txt CHANGELOG.md release/ | ||
| cd release | ||
| 7z a betlang-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip * | ||
| - uses: actions/upload-artifact@v7.0.1 | ||
| with: | ||
| name: betlang-windows | ||
| path: release/*.zip | ||
| build-lsp: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v7.0.1 | ||
| - name: Install Gleam | ||
| uses: erlef/setup-beam@v1.24.1 | ||
| with: | ||
| otp-version: '26' | ||
| gleam-version: 'latest' | ||
| - name: Build LSP | ||
| run: | | ||
| cd lsp/bet-lsp | ||
| gleam build --target erlang | ||
| gleam export erlang-shipment | ||
| cd build | ||
| tar -czvf bet-lsp-${{ github.ref_name }}.tar.gz erlang-shipment | ||
| - uses: actions/upload-artifact@v7.0.1 | ||
| with: | ||
| name: bet-lsp | ||
| path: lsp/bet-lsp/build/*.tar.gz | ||
| release: | ||
| needs: [build-linux, build-macos, build-windows, build-lsp] | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
| attestations: write | ||
| steps: | ||
| - uses: actions/checkout@v7.0.1 | ||
| - uses: actions/download-artifact@v8.0.1 | ||
| with: | ||
| path: artifacts | ||
| - name: Generate checksums | ||
| run: | | ||
| mkdir -p release | ||
| find artifacts -name '*.tar.gz' -o -name '*.zip' | xargs -I {} cp {} release/ | ||
| cd release | ||
| sha256sum * > SHA256SUMS.txt | ||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v3.0.3 | ||
| with: | ||
| files: release/* | ||
| generate_release_notes: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Attest build provenance | ||
| uses: actions/attest-build-provenance@v4.2.2 | ||
| with: | ||
| subject-path: 'release/*' | ||