ci: always have a nightly release (#1188)

* ci: pre-release a nightly build on every push

* ci: upload only bin, with name `pumpkin-<arch>-<os>`

* 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
This commit is contained in:
Jeromos Kovács
2025-12-06 10:18:18 +01:00
committed by GitHub
parent 168f885dda
commit 6591d3984d

View File

@@ -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