-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(repo): improve/fix release action (#14)
* ci: improve/fix release action Now, on each push on master, a new stable release is made following semver using commit logs with Knope * ci: better commitlint config * ci: adjust rust toolchain install * ci: add wasm target
- Loading branch information
1 parent
a97be4b
commit d9824f2
Showing
26 changed files
with
1,099 additions
and
507 deletions.
There are no files selected for viewing
Empty file.
File renamed without changes.
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,7 @@ | ||
extends: ['@commitlint/config-conventional'] | ||
|
||
rules: | ||
type-enum: | ||
- 2 | ||
- always | ||
- [arch, build, ci, docs, feat, fix, perf, refactor, test] |
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,29 @@ | ||
name: Setup Node & PNPM | ||
description: Install NodeJS and PNPM tooling | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
with: | ||
version: 9 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: |- | ||
${{ runner.os }}-pnpm-store- |
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,43 @@ | ||
name: Setup Rust | ||
description: Install Rust tooling with Cache | ||
|
||
inputs: | ||
target: | ||
description: Rust target platforms | ||
required: false | ||
default: x86_64-unknown-linux-gnu | ||
toolchain: | ||
description: Rust toolchain version to install | ||
required: true | ||
default: stable | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ inputs.toolchain }} | ||
target: ${{ inputs.target }} | ||
components: clippy, rustfmt | ||
|
||
- name: Cache Rust toolchain | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.rustup | ||
~/.cargo/bin | ||
key: ${{ runner.os }}-rust-${{ inputs.toolchain }}-${{ inputs.target }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-rust-${{ inputs.toolchain }}-${{ inputs.target }}- | ||
- name: Cache Cargo dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-rust-target-${{ inputs.toolchain }}-${{ inputs.target }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: |- | ||
${{ runner.os }}-rust-target-${{ inputs.toolchain }}-${{ inputs.target }}- |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Open Release PR | ||
|
||
on: | ||
push: | ||
branches: [main, staging, release] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CLICOLOR: 1 | ||
RUST_VERSION: 1.78.0 | ||
|
||
jobs: | ||
setup: | ||
if: "!startsWith(github.event.head_commit.message, 'ci(release)')" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
branch: ${{ steps.set-vars.outputs.branch }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check for pre-release configuration | ||
id: set-vars | ||
run: | | ||
echo "branch=changeset/release-main" >> $GITHUB_OUTPUT | ||
prepare-release: | ||
if: "!startsWith(github.event.head_commit.message, 'ci(release)')" | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.REPO_TOKEN }} | ||
|
||
- name: Configure Git | ||
run: | | ||
git config --global user.name GitHub Actions | ||
git config user.email github-actions@github.com | ||
- name: Install Rust | ||
uses: ./.github/actions/setup-rust | ||
with: | ||
toolchain: nightly | ||
|
||
- uses: taiki-e/cache-cargo-install-action@v2 | ||
with: | ||
tool: cargo-sort@1.0.9 | ||
|
||
- uses: taiki-e/cache-cargo-install-action@v2 | ||
with: | ||
tool: cargo-edit@0.12.3 | ||
|
||
- uses: knope-dev/action@v2.1.0 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run knope prepare release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} | ||
RELEASE_BRANCH: ${{ needs.setup.outputs.branch }} | ||
run: knope prepare-release --verbose |
Oops, something went wrong.