Skip to content

Commit 941bb5e

Browse files
authored
covector publishing and versioning (#85)
* covector publishing and versioning * lint guard
1 parent f091926 commit 941bb5e

9 files changed

Lines changed: 527 additions & 34 deletions

File tree

.changes/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
"package-a": patch
14+
"package-b": minor
15+
---
16+
17+
Change summary goes here
18+
19+
```
20+
21+
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.
22+
23+
Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).
24+
25+
Given a version number MAJOR.MINOR.PATCH, increment the:
26+
27+
- MAJOR version when you make incompatible API changes,
28+
- MINOR version when you add functionality in a backwards compatible manner, and
29+
- PATCH version when you make backwards compatible bug fixes.
30+
31+
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).

.changes/config.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"gitSiteUrl": "https://github.com/fxforge/starfx/",
3+
"additionalBumpTypes": ["housekeeping"],
4+
"changeTags": {
5+
"feat": "New Features",
6+
"enhance": "Enhancements",
7+
"bug": "Bug Fixes",
8+
"deps": "Dependencies",
9+
"internal": "Changes Supporting Development"
10+
},
11+
"pkgManagers": {
12+
"javascript": {
13+
"version": true,
14+
"getPublishedVersion": {
15+
"use": "fetch:check",
16+
"options": {
17+
"url": "https://registry.npmjs.com/${ pkg.pkg }/${ pkg.pkgFile.version }"
18+
}
19+
},
20+
"publish": ["npm publish --provenance --access public"]
21+
}
22+
},
23+
"packages": {
24+
"starfx": {
25+
"path": ".",
26+
"manager": "javascript"
27+
}
28+
}
29+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: covector comment
2+
3+
on:
4+
workflow_run:
5+
workflows: [covector status]
6+
types:
7+
- completed
8+
9+
# note all other permissions are set to none if not specified
10+
permissions:
11+
# to read the action artifacts
12+
actions: read
13+
# to write the comment
14+
pull-requests: write
15+
16+
jobs:
17+
download:
18+
runs-on: ubuntu-latest
19+
if: github.event.workflow_run.conclusion == 'success' &&
20+
(github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]')
21+
steps:
22+
- name: covector status
23+
uses: jbolda/covector/packages/action@covector-v0
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
command: "status"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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@v6
10+
with:
11+
fetch-depth: 0 # required for use of git history
12+
- name: covector status
13+
uses: jbolda/covector/packages/action@covector-v0
14+
id: covector
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
command: "status"
18+
comment: true
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: version or publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
# required for npm provenance
10+
id-token: write
11+
# required to create the GitHub Release
12+
contents: write
13+
# required for creating the Version Packages Release
14+
pull-requests: write
15+
16+
jobs:
17+
version-or-publish:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 65
20+
outputs:
21+
change: ${{ steps.covector.outputs.change }}
22+
commandRan: ${{ steps.covector.outputs.commandRan }}
23+
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
24+
25+
steps:
26+
- uses: actions/checkout@v6
27+
with:
28+
fetch-depth: 0 # required for use of git history
29+
- uses: actions/setup-node@v6
30+
with:
31+
node-version: 24.x
32+
- name: install
33+
run: npm ci
34+
35+
- name: git config
36+
run: |
37+
git config --global user.name "${{ github.event.pusher.name }}"
38+
git config --global user.email "${{ github.event.pusher.email }}"
39+
40+
- name: build
41+
run: npm run build
42+
43+
- name: covector version or publish (publish when no change files present)
44+
uses: jbolda/covector/packages/action@covector-v0
45+
id: covector
46+
with:
47+
token: ${{ secrets.GITHUB_TOKEN }}
48+
command: "version-or-publish"
49+
createRelease: true
50+
recognizeContributors: true
51+
52+
# We need to run npm again so that `package-lock.json`
53+
# is updated and the package.json is formatted per biome
54+
# if it needs to be before the PR is created
55+
- run: npm install
56+
if: steps.covector.outputs.commandRan == 'version'
57+
- run: npm run lint
58+
if: steps.covector.outputs.commandRan == 'version'
59+
60+
- name: Create Pull Request With Versions Bumped
61+
id: cpr
62+
uses: peter-evans/create-pull-request@v8
63+
if: steps.covector.outputs.commandRan == 'version'
64+
with:
65+
draft: true
66+
title: "Publish New Version"
67+
commit-message: "publish new versions"
68+
labels: "version updates"
69+
branch: "release"
70+
body: ${{ steps.covector.outputs.change }}

.github/workflows/release.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)