From 6591d3984d627d1f91dca12766e04e7c73f9a075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeromos=20Kov=C3=A1cs?= <118479592+jarjk@users.noreply.github.com> Date: Sat, 6 Dec 2025 10:18:18 +0100 Subject: [PATCH] ci: always have a nightly release (#1188) * ci: pre-release a nightly build on every push * ci: upload only bin, with name `pumpkin--` * ci: only run on push to `master` * ci: create a nightly tag for the release * ci: better nightly release artifact naming * ci(release): use 7 chars commit hash * ci: build for aarch64-macos and aarch64-linux as well --- .github/workflows/rust.yml | 50 +++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4cf87bb21..b78cc3835 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -41,7 +41,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest, ubuntu-24.04-arm] toolchain: - stable steps: @@ -55,7 +55,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest, ubuntu-24.04-arm] toolchain: - stable steps: @@ -65,12 +65,19 @@ jobs: - run: rustup component add rustfmt --toolchain ${{ matrix.toolchain }} - uses: Swatinem/rust-cache@v2 - run: cargo build --verbose --release + - name: Prepare artifacts + shell: bash + run: | + mkdir -p dist + if [ "${{ runner.os }}" == "Windows" ]; then EXT=".exe"; fi + cp "target/release/pumpkin$EXT" "dist/pumpkin-${{ runner.arch }}-${{ runner.os }}$EXT" - name: Export executable uses: actions/upload-artifact@v5 with: - name: pumpkin-${{ matrix.os }} + name: pumpkin-${{ runner.arch }}-${{ runner.os }} compression-level: 9 - path: target/${{ matrix.target }}/release/pumpkin* + path: dist/pumpkin-* + clippy_release: name: Run lints in release mode runs-on: ubuntu-latest @@ -84,3 +91,38 @@ jobs: - run: rustup component add clippy rustfmt --toolchain ${{ matrix.toolchain }} - uses: Swatinem/rust-cache@v2 - run: cargo clippy --release --all-targets --all-features + draft_release: + permissions: + contents: write + needs: [build_release] + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v5 + - name: Download prebuilt binary artifacts + uses: actions/download-artifact@v5 + with: + pattern: "**/pumpkin-*" + path: dist/ + merge-multiple: true + - name: Generate release notes + run: | + tree dist/ + echo "From commit: $(git rev-parse --short HEAD)" > dist/RELEASE.md + echo "Generated on: $(date -u +"%Y-%m-%d %H:%M") UTC" >> dist/RELEASE.md + cat dist/RELEASE.md + + - name: Update the nightly tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag --force nightly && git push --force origin tag nightly + + - name: Draft a nightly github release + uses: softprops/action-gh-release@v2 + with: + prerelease: true + files: dist/pumpkin* + tag_name: nightly + name: Nightly Build + body_path: dist/RELEASE.md