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
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,41 @@ on:
pull_request:
branches: [master]

permissions:
contents: read

# A newer push to the same pull request makes the older run moot.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all --check
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo test --workspace

# Releases ship macOS and Windows binaries; build them on every change, not first at tag time.
build:
name: build (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --workspace
25 changes: 19 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
artifact: scriptmark.exe

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
Expand All @@ -52,7 +54,7 @@ jobs:
run: cargo build --release -p scriptmark --target ${{ matrix.target }}

- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: scriptmark-${{ matrix.target }}
path: target/${{ matrix.target }}/release/${{ matrix.artifact }}
Expand All @@ -67,7 +69,7 @@ jobs:

steps:
- name: Download binaries
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
path: artifacts
pattern: scriptmark-*
Expand All @@ -83,7 +85,7 @@ jobs:
chmod +x release/scriptmark-*

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
files: release/*
Expand All @@ -99,8 +101,19 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable

- name: Publish crate
# Trusted Publishing: exchange this job's OIDC token for a short-lived crates.io token.
# Each crate must be configured on crates.io (Settings → Trusted Publishing: repository
# Acture/scriptmark, workflow release.yml, environment release), and a crate's first
# version must be published by hand with an API token.
- uses: rust-lang/crates-io-auth-action@v1
id: auth

- name: Publish crates
run: cargo publish --workspace
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
Loading