Skip to content

Commit 72e3fec

Browse files
authored
ci: Add covector to prepare publishing (#5)
* ci: Add covector to prepare publishing * use org token
1 parent 689b04e commit 72e3fec

6 files changed

Lines changed: 165 additions & 1 deletion

File tree

.changes/config.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"gitSiteUrl": "https://github.com/tauri-apps/winres/",
3+
"pkgManagers": {
4+
"rust": {
5+
"version": true,
6+
"getPublishedVersion": "cargo search ${ pkgFile.pkg.package.name } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -",
7+
"prepublish": [
8+
"cargo install cargo-audit --features=fix",
9+
{
10+
"command": "cargo generate-lockfile",
11+
"dryRunCommand": true,
12+
"runFromRoot": true,
13+
"pipe": true
14+
},
15+
{
16+
"command": "echo '<details>\n<summary><em><h4>Cargo Audit</h4></em></summary>\n\n```'",
17+
"dryRunCommand": true,
18+
"pipe": true
19+
},
20+
{
21+
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
22+
"dryRunCommand": true,
23+
"runFromRoot": true,
24+
"pipe": true
25+
},
26+
{
27+
"command": "echo '```\n\n</details>\n'",
28+
"dryRunCommand": true,
29+
"pipe": true
30+
}
31+
],
32+
"publish": [
33+
"sleep 15s",
34+
{
35+
"command": "cargo package --no-verify",
36+
"dryRunCommand": true
37+
},
38+
{
39+
"command": "echo '<details>\n<summary><em><h4>Cargo Publish</h4></em></summary>\n\n```'",
40+
"dryRunCommand": true,
41+
"pipe": true
42+
},
43+
{
44+
"command": "cargo publish",
45+
"dryRunCommand": "cargo publish --dry-run",
46+
"pipe": true
47+
},
48+
{
49+
"command": "echo '```\n\n</details>\n'",
50+
"dryRunCommand": true,
51+
"pipe": true
52+
}
53+
],
54+
"postpublish": ["git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f", "git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f", "git push --tags -f"],
55+
"assets": [
56+
{
57+
"path": "${ pkg.path }/target/package/${ pkg.pkg }-${ pkgFile.version }.crate",
58+
"name": "${ pkg.pkg }-${ pkgFile.version }.crate"
59+
}
60+
]
61+
}
62+
},
63+
"packages": {
64+
"winres": {
65+
"path": ".",
66+
"manager": "rust"
67+
}
68+
}
69+
}

.changes/initial-release.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'winres': minor
3+
---
4+
5+
Initial release.

.changes/readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changes
2+
3+
##### via https://github.com/jbolda/covector
4+
5+
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.
6+
7+
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.
8+
9+
Use the following format:
10+
11+
```md
12+
---
13+
'winres': patch
14+
---
15+
16+
Change summary goes here
17+
```
18+
19+
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.
20+
21+
Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).
22+
23+
Given a version number MAJOR.MINOR.PATCH, increment the:
24+
25+
- MAJOR version when you make incompatible API changes,
26+
- MINOR version when you add functionality in a backwards compatible manner, and
27+
- PATCH version when you make backwards compatible bug fixes.
28+
29+
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).
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: covector status
2+
on: [pull_request]
3+
4+
jobs:
5+
covector:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
fetch-depth: 0 # required for use of git history
12+
- name: covector status
13+
uses: jbolda/covector/packages/action@covector-v0.8
14+
id: covector
15+
with:
16+
command: 'status'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: version or publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
version-or-publish:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 65
12+
outputs:
13+
change: ${{ steps.covector.outputs.change }}
14+
commandRan: ${{ steps.covector.outputs.commandRan }}
15+
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0 # required for use of git history
21+
- name: cargo login
22+
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
23+
- name: git config
24+
run: |
25+
git config --global user.name "${{ github.event.pusher.name }}"
26+
git config --global user.email "${{ github.event.pusher.email }}"
27+
- name: covector version or publish (publish when no change files present)
28+
uses: jbolda/covector/packages/action@covector-v0.8
29+
id: covector
30+
env:
31+
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
32+
with:
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
command: 'version-or-publish'
35+
createRelease: true
36+
- name: Create Pull Request With Versions Bumped
37+
id: cpr
38+
uses: tauri-apps/create-pull-request@v3
39+
if: steps.covector.outputs.commandRan == 'version'
40+
with:
41+
title: 'Publish New Versions'
42+
commit-message: 'publish new versions'
43+
labels: 'version updates'
44+
branch: 'release'
45+
body: ${{ steps.covector.outputs.change }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tauri-winres"
33
description = "Create and set windows icons and metadata for executables"
4-
version = "0.1.0"
4+
version = "0.0.0"
55
authors = [
66
"Tauri Programme within The Commons Conservancy",
77
"Max Resch <resch.max@gmail.com>"

0 commit comments

Comments
 (0)