-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from moia-oss/use-release-plz
use release plz
- Loading branch information
Showing
4 changed files
with
41 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,53 +43,4 @@ jobs: | |
shared-key: debug-build-nightly | ||
- name: Make lint | ||
run: make lint | ||
semver: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: read | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Manually extract labels because rymndhng/release-on-push-action can't do this correctly on a PR | ||
- name: Extract labels | ||
id: extract_version_bump | ||
shell: bash | ||
run: | | ||
if [ ${{contains( github.event.pull_request.labels.*.name, 'release:major')}} = true ]; then | ||
echo "bump_version=major" >> $GITHUB_OUTPUT | ||
elif [ ${{contains( github.event.pull_request.labels.*.name, 'release:minor')}} = true ]; then | ||
echo "bump_version=minor" >> $GITHUB_OUTPUT | ||
elif [ ${{contains( github.event.pull_request.labels.*.name, 'norelease')}} = true ]; then | ||
echo "bump_version=" >> $GITHUB_OUTPUT | ||
else | ||
echo "bump_version=patch" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Calculate next version | ||
id: calc_version | ||
if: ${{ steps.extract_version_bump.outputs.bump_version }} != "" | ||
uses: rymndhng/release-on-push-action@master | ||
with: | ||
bump_version_scheme: ${{ steps.extract_version_bump.outputs.bump_version }} | ||
tag_prefix: "" | ||
dry_run: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Print version | ||
run: | | ||
echo "${{steps.calc_version.outputs.version}} ${{github.event.pull_request.labels}}" | ||
echo "${{ steps.extract_version_bump.outputs.bump_version }}" | ||
echo "${{toJson(github.event.pull_request.labels.*.name)}}" | ||
- name: Set version | ||
if: ${{ steps.extract_version_bump.outputs.bump_version }} != "" | ||
run: | | ||
sed -i "s/^version = \".*\"$/version = \"${{ steps.calc_version.outputs.version }}\"/" Cargo.toml | ||
- name: Commit new version to main but don't push | ||
if: ${{ steps.extract_version_bump.outputs.bump_version }} != "" | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "MOIA Rust Maintainers" | ||
git commit -am "Phantom release ${{ steps.calc_version.outputs.version }} [skip ci]" | ||
- name: Check semver | ||
if: ${{ steps.extract_version_bump.outputs.bump_version }} != "" | ||
uses: obi1kenobi/cargo-semver-checks-action@v2 | ||
with: | ||
version-tag-prefix: '' | ||
|
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
name: Run Release Plz | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: just | ||
- run: | | ||
echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUST_TOOLCHAIN }} | ||
- name: Run release-plz | ||
uses: MarcoIeni/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
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 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] |