-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
3 changed files
with
38 additions
and
17 deletions.
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
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 |
---|---|---|
|
@@ -5,16 +5,17 @@ permissions: | |
contents: write | ||
|
||
on: | ||
# Run this workflow against any branch that updates the TOML file. This can be used to create (pre)releases from any | ||
# branch (e.g. for hotfixes) without affecting the main branch. | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- 'Cargo.toml' | ||
|
||
jobs: | ||
# Build and packages all the things | ||
# Build and package all the things | ||
build-binaries: | ||
if: | | ||
contains(github.event.head_commit.message, 'chore: Release') | ||
contains(github.event.head_commit.message, 'chore: version v') | ||
strategy: | ||
matrix: | ||
# For these target platforms | ||
|
@@ -82,8 +83,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_TOKEN: ${{ secrets.GH_TOKEN_PAT }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PAT }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -96,8 +97,14 @@ jobs: | |
ls artifacts/**/* | ||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- run: | | ||
git config user.email "[email protected]" | ||
git config user.name "Github Automation" | ||
- id: release | ||
run: | | ||
export TAG=$(cargo metadata --format-version=1 --no-deps | jq '.packages[0].version' | tr -d '"') | ||
echo "Releasing "$TAG | ||
gh release create "v${TAG}" -n "Release of ${TAG}" -t "v${TAG}" --latest artifacts/**/*.tar.gz | ||
# Generate a GitHub pre-release. This will trigger the "prereleased" event that will deploy to Clay. When the | ||
# pre-release is promoted to a release from the GitHub console, the "released" event will trigger and deploy | ||
# to Prod. | ||
gh release create "v${TAG}" -t "v${TAG}" --generate-notes --prerelease artifacts/**/*.tar.gz |
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