Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: v0.6 #40

Merged
merged 2 commits into from
Oct 27, 2024
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
56 changes: 56 additions & 0 deletions .github/actions/changelog/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Generate changelog
description: Generate the changelog
outputs:
release-type:
description: Release type
value: ${{ steps.log.outputs.release-type }}
version:
description: Next version
value: ${{ steps.log.outputs.next-version }}
issues-closed:
description: Issues closed
value: ${{ steps.log.outputs.issues-closed }}
changelog:
description: Changelog value
value: ${{ steps.log.outputs.changelog }}
should-release:
description: Should release
value: ${{ steps.log.outputs.should-release }}
runs:
using: composite
steps:
- name: Conditional args
id: args
if: ${{ startsWith(github.ref, 'refs/tags/') }}
shell: bash
run: >
echo "before=${{ github.ref_name }}" >> $GITHUB_OUTPUT &&
echo "until=${{ github.ref_name }}" >> $GITHUB_OUTPUT

- name: Get last tag
id: last-tag
uses: alorel-actions/semantic-release-lite/last-tag@v0
with:
before: ${{ steps.args.outputs.before }}

- name: Generate changelog
id: log
uses: alorel-actions/semantic-release-lite/generate-changelog@v0
with:
last-tag: ${{ steps.last-tag.outputs.last-tag }}
from: ${{ steps.last-tag.outputs.last-tag }}
until: ${{ steps.args.outputs.until || github.sha }}
stay-at-zero: true
minor-types: |
feat: Features
rm: Removals
patch-types: |
fix: Bug Fixes
perf: Performance
chore: Maintenance
deps: Dependency updates
refactor: Refactors
docs: Documentation
trivial-types: |
ci: CI & Build
build: CI & Build
30 changes: 0 additions & 30 deletions .github/actions/prep-release/action.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/actions/release/action.yml

This file was deleted.

71 changes: 0 additions & 71 deletions .github/workflows/_test.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/release-crate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release (crates.io)
concurrency: release-crate
on:
push:
tags:
- v*

permissions:
contents: read

jobs:
release:
name: Release (crates.io)
runs-on: ubuntu-latest
environment: crates-io
env:
CARGO_INCREMENTAL: 0
steps:
- uses: actions/checkout@v4
name: Checkout

- name: Init toolchain
uses: alorel-actions/cargo/init@v1
with:
cache-prefix: release

- name: Publish crate
run: cargo publish --locked --token ${{ secrets.CRATES_IO_TOKEN }}
87 changes: 45 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
name: Release
concurrency: release
name: Release (GitHub)
concurrency: release-git
on:
workflow_dispatch: {}
workflow_dispatch: { }

permissions:
contents: read

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: --deny warnings

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

release:
name: Release
needs:
- test
git:
name: Git release
runs-on: ubuntu-latest
environment: crates-io
environment: github
permissions:
contents: write
outputs:
issues-closed: ${{ steps.changelog.outputs.issues-closed }}
version: ${{ steps.changelog.outputs.version }}
steps:
- uses: actions/checkout@v4
name: Checkout
Expand All @@ -31,37 +27,44 @@ jobs:
fetch-tags: true
token: ${{ secrets.GH_TOKEN }}

- name: Parse
id: parse
uses: alorel-actions/semantic-release-lite@v0
- name: Git identity
uses: alorel-actions/git-ident@v1

- name: Generate changelog
id: changelog
uses: ./.github/actions/changelog

- name: Init toolchain
uses: alorel-actions/cargo/init@v1
with:
cache-prefix: release

- name: cargo-bump
uses: alorel-actions/cargo/bump@v1
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
release-type: ${{ steps.changelog.outputs.release-type }}

- name: Prep release
if: ${{ steps.parse.outputs.should-release }}
id: prep
uses: ./.github/actions/prep-release
- name: Git release
uses: alorel-actions/cargo/release-git@v1
with:
release-type: ${{ steps.parse.outputs.release-type }}
version: ${{ steps.parse.outputs.next-version }}
version: ${{ steps.changelog.outputs.version }}
changelog: ${{ steps.changelog.outputs.changelog }}

- name: Release
if: ${{ steps.prep.outputs.in-sync }}
uses: ./.github/actions/release
notify:
name: Notify closed issues
needs:
- git
if: ${{ needs.git.outputs.issues-closed }}
runs-on: ubuntu-latest
environment: github
permissions:
contents: write
steps:
- name: Notify
if: ${{ needs.git.outputs.issues-closed }}
uses: alorel-actions/semantic-release-lite/notify@v0
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 }}
tag: ${{ needs.git.outputs.version }}
issues: ${{ needs.git.outputs.issues-closed }}
allow-out-of-sync: true
gh-token: ${{ secrets.GH_TOKEN }}
Loading