ci: initial wip release process #4
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
| name: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - beta | |
| - alpha | |
| - "*.x" | |
| - "jg/release-setup" | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| get-next-version: | |
| uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@v4 | |
| hello-world-job: | |
| runs-on: ubuntu-latest | |
| name: A job to say hello | |
| needs: | |
| - get-next-version | |
| if: needs.get-next-version.outputs.new-release-published == 'true' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - id: foo | |
| uses: ./.github/actions/hello-world-composite-action | |
| with: | |
| who-to-greet: "Mona the Octocat" | |
| - run: echo random-number "$RANDOM_NUMBER" | |
| shell: bash | |
| env: | |
| RANDOM_NUMBER: ${{ steps.foo.outputs.random-number }} | |
| # TODO: test, lint, build... ideally reference the validate workflow | |
| # build: | |
| # runs-on: ubuntu-latest | |
| # name: Build | |
| # if: needs.get-next-version.outputs.new-release-published == 'true' | |
| # steps: | |
| # - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 | |
| # - run: cargo build -r | |
| # release: | |
| # runs-on: ubuntu-22.04 | |
| # name: Release | |
| # if: needs.get-next-version.outputs.new-release-published == 'true' | |
| # needs: | |
| # # - build | |
| # - get-next-version | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v5 | |
| # with: | |
| # # Fetch all history and tags for calculating next semantic version | |
| # fetch-depth: 0 | |
| # - name: Install Rust toolchain | |
| # uses: dtolnay/rust-toolchain@master | |
| # id: rust-toolchain | |
| # with: | |
| # toolchain: stable | |
| # - name: Cache cargo | |
| # uses: actions/cache@v4 | |
| # id: cache-cargo | |
| # with: | |
| # path: | | |
| # ~/.cargo/bin/ | |
| # ~/.cargo/registry/index/ | |
| # ~/.cargo/registry/cache/ | |
| # ~/.cargo/git/db/ | |
| # target/ | |
| # key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }} | |
| # - name: Setup Node.js | |
| # uses: actions/setup-node@v6 | |
| # with: | |
| # node-version: lts/* | |
| # check-latest: true | |
| # cache: npm | |
| # - name: Cache npm dependencies | |
| # uses: actions/cache@v4 | |
| # id: cache-node-modules | |
| # with: | |
| # path: node_modules | |
| # key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
| # - name: Install dependencies | |
| # if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
| # run: npm ci --ignore-scripts --loglevel error | |
| # - name: Download release artifacts | |
| # uses: actions/download-artifact@v6 | |
| # with: | |
| # path: artifacts | |
| # - name: ls artifacts | |
| # run: ls -R ./artifacts | |
| # - name: Prepare native artifacts | |
| # run: | | |
| # mkdir napi/ | |
| # mv artifacts/bindings-aarch64-apple-darwin/semantic-release-cargo.darwin-arm64.node napi/ | |
| # mv artifacts/bindings-x86_64-apple-darwin/semantic-release-cargo.darwin-x64.node napi/ | |
| # mv artifacts/bindings-x86_64-unknown-linux-gnu/semantic-release-cargo.linux-x64-gnu.node napi/ | |
| # - name: ls napi | |
| # run: ls -R ./napi | |
| # - name: Prepare GitHub Release artifacts | |
| # run: | | |
| # mkdir dist/ | |
| # mv artifacts/aarch64-apple-darwin dist/ | |
| # mv artifacts/aarch64-unknown-linux-gnu dist/ | |
| # mv artifacts/aarch64-unknown-linux-musl dist/ | |
| # mv artifacts/i686-unknown-linux-gnu dist/ | |
| # mv artifacts/i686-unknown-linux-musl dist/ | |
| # mv artifacts/x86_64-apple-darwin dist/ | |
| # mv artifacts/x86_64-unknown-linux-gnu dist/ | |
| # mv artifacts/x86_64-unknown-linux-musl dist/ | |
| # - name: Combine checksums | |
| # run: cat dist/**/semantic-release-cargo-*-SHA256SUM.txt | tee dist/SHA256SUMS.txt | |
| # - name: Prepare semantic-release-cargo for local use | |
| # run: | | |
| # cp dist/x86_64-unknown-linux-musl/semantic-release-cargo-x86_64-unknown-linux-musl ./semantic-release-cargo | |
| # chmod +x ./semantic-release-cargo | |
| # - name: Invoke semantic-release | |
| # env: | |
| # # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # run: npx semantic-release |