Skip to content

Commit

Permalink
ci: Move releases to dedicated branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Jul 26, 2024
1 parent effcdad commit 04e688b
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 129 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Test
on:
workflow_call: {}

permissions:
contents: read

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: --deny warnings

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Init toolchain
uses: alorel-actions/cargo/init@v1
id: toolchain
with:
components: rustfmt,clippy
cache-prefix: lint
local: true

- name: Fmt
run: cargo fmt --check

- name: Clippy
run: cargo clippy --workspace --tests

- name: Doc
run: cargo doc --workspace --no-deps

test:
name: Test on ${{matrix.toolchain}}
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly-2024-07-25
- stable
- 1.74.0
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Init toolchain
uses: alorel-actions/cargo/init@v1
with:
toolchain: ${{matrix.toolchain}}
cache-prefix: test
local: true

- name: Install wasm-pack
uses: alorel-actions/cargo-global-dep@v1
with:
name: wasm-pack
version: 0.12.1

- name: Test (no features)
run: wasm-pack test --headless --firefox --chrome --locked --no-default-features

- name: Test (default features)
run: wasm-pack test --headless --firefox --chrome --locked

- name: Test (nightly)
run: wasm-pack test --headless --firefox --chrome --locked --all-features
if: ${{startsWith(matrix.toolchain, 'nightly')}}
129 changes: 0 additions & 129 deletions .github/workflows/core.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release
concurrency: release
on:
push:
branches:
- release

permissions:
contents: read

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: --deny warnings

jobs:
test:
name: Test
uses: ./.github/workflows/_test.yml

release:
name: Release
needs:
- test
runs-on: ubuntu-latest
environment: crates-io
permissions:
contents: write
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.GH_TOKEN }}

- name: Parse
id: parse
uses: alorel-actions/semantic-release-lite@v0
with:
stay-at-zero: true
minor-types: |
feat: Features
patch-types: |
fix: Bug Fixes
trivial-types: |
chore: Maintenance
deps: Dependency updates
ci: CI & Build
build: CI & Build
refactor: Refactors
docs: Documentation
perf: Performance
- name: Prep release
if: ${{ steps.parse.outputs.should-release }}
id: prep
uses: ./.github/actions/prep-release
with:
release-type: ${{ steps.parse.outputs.release-type }}
version: ${{ steps.parse.outputs.next-version }}

- name: Release
if: ${{ steps.prep.outputs.in-sync }}
uses: ./.github/actions/release
with:
version: ${{ steps.parse.outputs.next-version }}
changelog: ${{ steps.parse.outputs.changelog }}
issues-closed: ${{ steps.parse.outputs.issues-closed }}
crates-io-token: ${{ secrets.CRATES_IO_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test
on:
push:
branches:
- master
paths-ignore:
- .github/CODE_OF_CONDUCT.md
- .github/CODEOWNERS
- .github/dependabot.yml
- .github/FUNDING.yml
- LICENSE
- .gitignore
pull_request:
paths-ignore:
- .github/CODE_OF_CONDUCT.md
- .github/CODEOWNERS
- .github/dependabot.yml
- .github/FUNDING.yml
- LICENSE
- .gitignore

permissions:
contents: read

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: --deny warnings

jobs:
test:
name: Test
uses: ./.github/workflows/_test.yml

0 comments on commit 04e688b

Please sign in to comment.