Skip to content

Commit 5564952

Browse files
authored
fix #183: update publication workflow (#184)
* fix #183: update publication workflow * update releasing instructions in CONTRIBUTING.md * fix main workflow
1 parent bf83163 commit 5564952

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

.github/workflows/main.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ jobs:
3333
- run: git config --local user.name "GitHub Action"
3434
#- run: yarn config set version-sign-git-tag true
3535
- run: |
36-
if [ ${{ github.event.client_payload.version }} == "prerelease" ]; then
37-
yarn run release ${{ github.event.client_payload.version }} --tag=beta
36+
if [[ ${{ github.event.inputs.version }} == *"-"* ]]; then
37+
yarn publish --new-version ${{ github.event.inputs.version }} --tag=beta
3838
else
39-
yarn run release ${{ github.event.client_payload.version }}
40-
fi
39+
yarn publish --new-version ${{ github.event.inputs.version }}
40+
fi
4141
env:
4242
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
43+
- run: git push

.github/workflows/manual.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: 'Version to release: "X.Y.Z" or "prerelease" for beta'
7+
description: 'Version to release: "X.Y.Z", or "X.Y.Z-beta" for beta'
88
required: true
9-
default: 'prerelease'
109

1110
jobs:
1211
build:
1312
runs-on: ubuntu-latest
1413
steps:
15-
- name: Get tag number
16-
id: get_tag
17-
run: echo ::set-output name=TAG::$(echo $GITHUB_REF | cut -d / -f 3)
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-node@v1
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
filter: 'blob:none'
18+
- uses: actions/setup-node@v4
2019
with:
2120
node-version: 20
2221
registry-url: https://registry.npmjs.org/
2322
- name: Cache node modules
24-
uses: actions/cache@v1
23+
uses: actions/cache@v4
2524
env:
2625
cache-name: cache-node-modules
2726
with:
@@ -31,16 +30,16 @@ jobs:
3130
${{ runner.os }}-build-${{ env.cache-name }}-
3231
${{ runner.os }}-build-
3332
${{ runner.os }}-
34-
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
3533
- run: yarn install
3634
- run: git config --local user.email "action@github.com"
3735
- run: git config --local user.name "GitHub Action"
3836
#- run: yarn config set version-sign-git-tag true
3937
- run: |
40-
if [ ${{ github.event.inputs.version }} == "prerelease" ]; then
41-
yarn run release ${{ github.event.inputs.version }} --tag=beta
38+
if [[ ${{ github.event.inputs.version }} == *"-"* ]]; then
39+
yarn publish --new-version ${{ github.event.inputs.version }} --tag=beta
4240
else
43-
yarn run release ${{ github.event.inputs.version }}
44-
fi
41+
yarn publish --new-version ${{ github.event.inputs.version }}
42+
fi
4543
env:
4644
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
45+
- run: git push --tags

CONTRIBUTING.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,27 @@
1717
* [@vsct-jburet](https://github.com/vsct-jburet)
1818
* [@MaximeLeFrancois](https://github.com/MaximeLeFrancois)
1919
* [@delphes99](https://github.com/delphes99)
20+
* [@Fabilin](https://github.com/Fabilin)
2021

2122
# GITHUB ACTION FOR PUBLISHING
2223

2324
## Build, tag and publish new version
2425

25-
Warning: "Require signed commits" on master branch must be unchecked (https://github.com/theopenconversationkit/tock-react-kit/settings/branch_protection_rules/11667069)
26+
1. Ensure a milestone exists for the new version (https://github.com/theopenconversationkit/tock-react-kit/milestones)
27+
and that all relevant issues are assigned to it
28+
2. Run the [manual release workflow](https://github.com/theopenconversationkit/tock-react-kit/actions/workflows/manual.yaml)
29+
with the new version number
30+
3. Create a [GitHub release](https://github.com/theopenconversationkit/tock-react-kit/releases) using the tag created by the workflow
2631

27-
curl \
28-
-H "Accept: application/vnd.github.everest-preview+json" \
29-
-H "Authorization: token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
30-
--request POST \
31-
--data '{"event_type": "publish", "client_payload": {"version": "X.Y.Z"} }'
32-
https://api.github.com/repos/theopenconversationkit/tock-react-kit/dispatches
32+
### Versioning
3333

34-
You can also build a beta version using "prerelease" keyword
34+
Our versioning is based on [Semantic Versioning](https://semver.org), with some tweaks to tie the version to our release schedule:
35+
- The major and minor components are repurposed to denote respectively the release year and month of the current major version.
36+
We release two major versions per year, one in March and one in September.
37+
- The patch version component keeps the same meaning as in semver. We release patch versions at any time.
38+
- The additional labels for pre-release and build metadata keep the same meaning as in semver
3539

36-
curl \
37-
-H "Accept: application/vnd.github.everest-preview+json" \
38-
-H "Authorization: token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
39-
--request POST \
40-
--data '{"event_type": "publish", "client_payload": {"version": "prerelease"} }'
41-
https://api.github.com/repos/theopenconversationkit/tock-react-kit/dispatches
42-
40+
For example:
41+
- 23.3.0 is the major version released in March 2023. The next major version is 23.9.0, released in September of the same year.
42+
- 23.9.2 is the second patch version for the 23.9 major, and may be released any time between September 2023 and March 2024.
43+
- 24.9.0-beta.1 is the first beta for the upcoming 24.9.0 major version.

0 commit comments

Comments
 (0)