Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish to crates.io

on:
push:
tags: ["v*"] # Triggers when pushing tags starting with 'v'

jobs:
publish:
runs-on: ubuntu-latest
# environment: release # Optional: for enhanced security
permissions:
id-token: write # Required for OIDC token exchange
steps:
- uses: actions/checkout@v7
- uses: rust-lang/crates-io-auth-action@v1.0.5
id: auth
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: GitHub Release

on:
push:
tags:
- "v*"

jobs:
build:
name: ${{ matrix.target }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary: matrixfall
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: matrixfall.exe
- os: macos-latest
target: x86_64-apple-darwin
binary: matrixfall

runs-on: ${{ matrix.os }}
permissions:
id-token: write
attestations: write

steps:
- uses: actions/checkout@v7

- name: Build
run: cargo build --release

- name: Generate provenance
uses: actions/attest-build-provenance@v4
with:
subject-path: target/release/${{ matrix.binary }}

- name: Upload artifact
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ matrix.target }}
path: target/release/${{ matrix.binary }}

release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Download all artifacts
uses: actions/download-artifact@v8.0.1
with:
path: artifacts

- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
artifacts/x86_64-unknown-linux-gnu/matrixfall \
artifacts/x86_64-pc-windows-msvc/matrixfall.exe \
artifacts/x86_64-apple-darwin/matrixfall \
--generate-notes \
--title "${{ github.ref_name }}"