Skip to content

Commit

Permalink
ci: switch release-plz to covector
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuciael committed Sep 13, 2023
1 parent 57986b2 commit 177207d
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 13 deletions.
22 changes: 22 additions & 0 deletions .changes/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"gitSiteUrl": "https://github.com/zakuciael/nosapi/",
"pkgManagers": {
"rust": {
"version": true,
"getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -",
"publish": [
"cargo publish"
]
}
},
"packages": {
"nosapi_server": {
"path": "./apps/nosapi_server",
"manager": "rust"
},
"nosapi_data": {
"path": "./crates/nosapi_data",
"manager": "rust"
}
}
}
31 changes: 31 additions & 0 deletions .changes/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changes

##### via https://github.com/jbolda/covector

As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes.

When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.

Use the following format:

```md
---
"package-a": patch
"package-b": minor
---

Change summary goes here

```

Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.

Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).

Given a version number MAJOR.MINOR.PATCH, increment the:

- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).
37 changes: 26 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,34 @@ concurrency:

jobs:
release:
name: Prepare / Publish a release
runs-on: ubuntu-latest
outputs:
change: ${{ steps.covector.outputs.change }}
commandRan: ${{ steps.covector.outputs.commandRan }}
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Run release-plz
uses: MarcoIeni/release-plz-action@v0.5
- name: Setup git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
git config --global user.email "${{ github.event.pusher.email }}"
- name: Run covector version or publish
uses: jbolda/covector/packages/action@covector-v0.10
id: covector
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: 'version-or-publish'
createRelease: true
- name: Create Pull Request with versions bumped
id: cpr
uses: peter-evans/create-pull-request@v3
if: steps.covector.outputs.commandRan == 'version'
with:
title: "chore: release"
commit-message: "chore: release"
branch: "release"
body: ${{ steps.covector.outputs.change }}
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ resolver = "2"
members = [
"apps/nosapi_server",
"crates/nosapi_data"
]
]

[workspace.package]
authors = ["Krzysztof Saczuk <me@krzysztofsaczuk.pl>"]
2 changes: 1 addition & 1 deletion crates/nosapi_data/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "nosapi_data"
version = "0.1.0"
edition = "2021"
authors.workspace = true

[dependencies]
byteorder = "1.4.3"
Expand Down

0 comments on commit 177207d

Please sign in to comment.