Skip to content

chore: Release

chore: Release #16

Workflow file for this run

name: Build and publish release
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
build_release:
strategy:
matrix:
include:
- os: ubuntu-latest
bin: esdump-rs
target: x86_64-unknown-linux-gnu
suffix: tar.gz
- os: macOS-latest
bin: esdump-rs
target: aarch64-apple-darwin
suffix: tar.gz
- os: windows-latest
bin: esdump-rs.exe
target: x86_64-pc-windows-msvc
suffix: zip
name: cargo build
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
attestations: write
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
# Only cache the cargo registry
cache-targets: false
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- run: cargo build --target=${{ matrix.target }} --release --locked
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- run: cp target/${{ matrix.target }}/release/${{ matrix.bin }} ${{ matrix.bin }}
- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: '${{ github.workspace }}/${{ matrix.bin }}'
- if: matrix.os == 'windows-latest'
run: |
7z a "${{ matrix.target}}.${{ matrix.suffix }}" ${{ matrix.bin }}
- if: matrix.os != 'windows-latest'
run: |
tar czvf "${{ matrix.target}}.${{ matrix.suffix }}" ${{ matrix.bin }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target}}.${{ matrix.suffix }}
path: ${{ matrix.target}}.${{ matrix.suffix }}
retention-days: 1
create_release:
name: Release
runs-on: ubuntu-latest
needs:
- build_release
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
- name: Publish
uses: softprops/action-gh-release@v2
with:
draft: false
files: |
**/*.tar.gz
**/*.zip