-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d96db42
commit f59845f
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
|
||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
publish-dry-run: | ||
name: Test Publish with Dry Run | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: publish crate | ||
run: cargo publish -p couriers --dry-run | ||
|
||
publish: | ||
name: Publish Crate | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Login to Crates.io | ||
run: cargo login ${CRATES_IO_TOKEN} | ||
env: | ||
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | ||
|
||
- name: Publish crate | ||
run: cargo publish -p couriers | ||
|
||
release: | ||
name: Create Release | ||
needs: publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
await github.request(`POST /repos/${{ github.repository }}/releases`, { | ||
tag_name: "${{ github.ref }}", | ||
generate_release_notes: true | ||
}); |
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