This file contains 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: Staging | ||
on: | ||
workflow_dispatch: | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
build: | ||
name: Build ${{ matrix.target.name }} package | ||
runs-on: ${{ matrix.target.os }} | ||
strategy: | ||
matrix: | ||
target: | ||
[ | ||
{ name: x86_64-unknown-linux-gnu, os: ubuntu-latest }, | ||
{ name: aarch64-apple-darwin, os: macos-latest }, | ||
{ | ||
name: x86_64-pc-windows-msvc, | ||
os: windows-latest, | ||
extension: .exe, | ||
}, | ||
] | ||
steps: | ||
- name: Fetch latest code | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust toolchain | ||
run: rustup target add ${{ matrix.target.name }} | ||
- name: Build | ||
run: cargo build --profile ci-release --locked --target ${{ matrix.target.name }} | ||
- name: Compress | ||
run: | | ||
mv target/${{ matrix.target.name }}/ci-release/<NAME>${{ matrix.target.extension }} . | ||
zstd --ultra -22 -o <NAME>-${{ matrix.target.name }}.zst <NAME>${{ matrix.target.extension }} | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: <NAME>-${{ matrix.target.name }} | ||
path: <NAME>-${{ matrix.target.name }}.zst | ||
retention-days: 1 | ||
staging: | ||
name: Staging | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Publish | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
discussion_category_name: Announcements | ||
generate_release_notes: true | ||
staging: | ||
name: Staging | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: artifacts | ||
path: artifacts | ||
- name: Hash | ||
run: | | ||
mkdir -p artifacts | ||
mv <NAME>-*/* artifacts/ | ||
cd artifacts | ||
sha256sum * | tee ../SHA256 | ||
md5sum * | tee ../MD5 | ||
mv ../SHA256 . | ||
mv ../MD5 . | ||
ls -al | ||
# - name: Publish | ||
# uses: softprops/action-gh-release@v2 | ||
# with: | ||
# discussion_category_name: Announcements | ||
# generate_release_notes: true | ||
# files: artifacts/* | ||
# publish-on-crates-io: | ||
# name: Publish on crates.io | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Fetch latest code | ||
# uses: actions/checkout@v4 | ||
# - name: Login | ||
# run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
# - name: Publish | ||
# run: cargo publish --locked | ||
# publish-on-crates-io: | ||
# name: Publish on crates.io | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Fetch latest code | ||
# uses: actions/checkout@v4 | ||
# - name: Login | ||
# run: cargo login ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
# - name: Publish | ||
# run: .maintain/release.sh |