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
34 changes: 31 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
run: cargo install toml-cli
- name: Check version
run: test "v$(toml get -r Cargo.toml package.version)" = "${{ github.ref_name }}"
- name: Verify Cargo.lock matches Cargo.toml
run: cargo metadata --locked --format-version=1 > /dev/null

# Cross-compiled Linux binaries using `cross`
build-linux:
Expand All @@ -35,7 +37,7 @@ jobs:
run: cargo install cross

- name: Build with cross
run: cross build --release --target ${{ matrix.target }}
run: cross build --locked --release --target ${{ matrix.target }}

- name: Rename binary
run: |
Expand All @@ -61,7 +63,7 @@ jobs:
run: rustup target add ${{ matrix.target }}

- name: Build (macOS)
run: cargo build --release --target ${{ matrix.target }}
run: cargo build --locked --release --target ${{ matrix.target }}

- name: Rename binary
run: |
Expand All @@ -83,9 +85,35 @@ jobs:
merge-multiple: true
path: dist

- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Generate release notes
id: release_notes
run: |
set -e

echo -e "This release contains the following changes:\n\n---\n" > release_notes.md

PREV_TAG=$(git describe --tags --abbrev=0 "${GITHUB_REF_NAME}^" 2>/dev/null || echo "")

if [ -z "$PREV_TAG" ]; then
echo "No previous tag found, including all merge commits."
git log --merges --pretty=format:'### %s%n%n%b%n%n---' >> release_notes.md
else
echo "Previous tag: $PREV_TAG"
git log "$PREV_TAG"..HEAD --merges --pretty=format:'### %s%n%n%b%n%n---' >> release_notes.md
fi

echo "Generated release notes:"
cat release_notes.md

- uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
bodyFile: release_notes.md

publish-to-crates-io:
needs: [build-linux, build-macos]
Expand All @@ -95,7 +123,7 @@ jobs:
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish --no-verify
run: cargo publish --locked --no-verify

update-homebrew-tap:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
release_notes.md