Skip to content

Commit d9b7ba2

Browse files
Merge pull request #66 from Chia-Network/develop
Release 1.0.3
2 parents 6a0783d + cec3e8a commit d9b7ba2

12 files changed

+599
-338
lines changed

.github/workflows/auto-release-rc.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Compares the version in package.json to tags on the repo. If the tag doesn't exist, a new tag is created, which
2+
# then triggers the normal "on tag" release automation in the build job
3+
name: Auto Tag RC
4+
5+
on:
6+
push:
7+
branches:
8+
- develop
9+
10+
concurrency:
11+
group: rc-release-check
12+
13+
jobs:
14+
release-dev:
15+
name: Release rc version
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout current branch
19+
uses: actions/checkout@v4
20+
with:
21+
# Need REPO_COMMIT token so when the tag is created, the tag automation runs
22+
token: ${{ secrets.REPO_COMMIT }}
23+
fetch-depth: 0
24+
25+
- name: Setup commit signing for ChiaAutomation
26+
uses: Chia-Network/actions/commit-sign/gpg@main
27+
with:
28+
gpg_private_key: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_KEY }}
29+
passphrase: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_PASSPHRASE }}
30+
31+
- name: Check for current version tag. Create if it doesn't exist
32+
env:
33+
GH_TOKEN: ${{ github.token }}
34+
run: |
35+
stable_version=$(gh release list --limit 1 --order desc --exclude-pre-releases --json tagName --jq ".[].tagName")
36+
echo "Latest release is $stable_version"
37+
rc_version=$(gh release list --json tagName --jq ".[] | select(.tagName | test(\"${version}-rc*\")) | .tagName")
38+
echo "Latest release candidate is $rc_version"
39+
40+
if [[ -z ${rc_version} ]]; then
41+
# Extract the major, minor, and patch versions
42+
IFS='.' read -r major minor patch <<< "$stable_version"
43+
44+
# Increment the patch version
45+
new_patch=$((patch + 1))
46+
47+
# Construct the new version string
48+
version="$major.$minor.$new_patch-rc1"
49+
50+
echo "New version: $version"
51+
52+
else
53+
# Extract the major, minor, patch, and rc parts
54+
IFS='.-' read -r major minor patch rc <<< "$rc_version"
55+
56+
# Extract just the number of the rc
57+
rc_number="${rc#rc}"
58+
59+
# Increment the rc number
60+
rc_number=$((rc_number +1))
61+
62+
# Construct the new version string
63+
version="$major.$minor.$patch-rc$rc_number"
64+
65+
echo "New version: $version"
66+
67+
fi
68+
69+
if [ $(git tag -l "$version") ]; then
70+
echo "$version tag exists, deleting..."
71+
git tag -d $version
72+
git push --delete origin $version
73+
fi
74+
echo "Tag does not exist. Creating and pushing tag"
75+
rm -f CHANGELOG.md
76+
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0
77+
changes=$(npx conventional-changelog-cli -r 1 | tail -n +2)
78+
git tag $version -m "Release $version $changes"
79+
git push origin $version

.github/workflows/build-installers.yaml

+76-21
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ on:
44
push:
55
tags:
66
- '**'
7-
branches:
8-
- refactor/refactor-base #remove this once rebuild is merged
97
pull_request:
108
branches:
119
- '**'
1210

1311
concurrency:
14-
# SHA is added to the end if on `main` to let all main workflows run
15-
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
12+
group: ${{ github.ref }}-${{ github.workflow }}
1613
cancel-in-progress: true
1714

1815
permissions:
@@ -27,26 +24,35 @@ jobs:
2724
name: Build Mac Installer
2825
runs-on: macos-latest
2926
steps:
30-
- uses: Chia-Network/actions/clean-workspace@main
31-
3227
- name: Checkout Code
3328
uses: actions/checkout@v4
3429

3530
- name: Setup Node 20
3631
uses: actions/setup-node@v4
3732
with:
38-
node-version: '20.10'
33+
node-version: '20.16'
3934

4035
- name: Install Husky
4136
run: npm install --save-dev husky
4237

4338
- name: install dmg-license
4439
run: npm i dmg-license
4540

41+
- name: Change the package.json version if an RC tag
42+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
43+
shell: bash
44+
run: |
45+
echo "Github ref: $GITHUB_REF"
46+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
47+
echo "Extracted tag is $tag"
48+
49+
jq ".version = \"${tag}\"" package.json > package.tmp
50+
mv package.tmp package.json
51+
4652
- name: npm install
4753
run: |
4854
npm install
49-
55+
5056
- name: Test for secrets access
5157
id: check_secrets
5258
shell: bash
@@ -59,7 +65,7 @@ jobs:
5965
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
6066

6167
- name: Import Apple installer signing certificate
62-
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET
68+
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET && startsWith(github.ref, 'refs/tags/')
6369
uses: Apple-Actions/import-codesign-certs@v1
6470
with:
6571
p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }}
@@ -71,7 +77,7 @@ jobs:
7177
run: npm run electron:package:mac
7278

7379
- name: Notarize
74-
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET
80+
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET && startsWith(github.ref, 'refs/tags/')
7581
run: |
7682
DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg')
7783
xcrun notarytool submit \
@@ -94,17 +100,26 @@ jobs:
94100
- name: Checkout Code
95101
uses: actions/checkout@v4
96102

97-
- name: Setup Node 20.10
103+
- name: Setup Node 20.16
98104
uses: actions/setup-node@v4
99105
with:
100-
node-version: '20.10'
106+
node-version: '20.16'
101107

102108
- name: Install Husky
103109
run: npm install --save-dev husky
104110

105111
- name: Ignore Husky where not compatible
106112
run: npm pkg delete scripts.prepare
107113

114+
- name: Change the package.json version if an RC tag
115+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
116+
shell: bash
117+
run: |
118+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
119+
120+
jq ".version = \"${tag}\"" package.json > package.tmp
121+
mv package.tmp package.json
122+
108123
- name: npm install
109124
run: |
110125
node --version
@@ -123,7 +138,7 @@ jobs:
123138
echo "HAS_SIGNING_SECRET=${HAS_SIGNING_SECRET}" >> "$GITHUB_OUTPUT"
124139
env:
125140
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
126-
141+
127142
# Windows Code Signing
128143
- name: Get installer name for signing
129144
shell: bash
@@ -155,14 +170,22 @@ jobs:
155170
- name: Checkout Code
156171
uses: actions/checkout@v4
157172

158-
- name: Setup Node 20.10
173+
- name: Setup Node 20.16
159174
uses: actions/setup-node@v4
160175
with:
161-
node-version: '20.10'
176+
node-version: '20.16'
162177

163178
- name: Install Husky
164179
run: npm install --save-dev husky
165180

181+
- name: Change the package.json version if an RC tag
182+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
183+
run: |
184+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
185+
186+
jq ".version = \"${tag}\"" package.json > package.tmp
187+
mv package.tmp package.json
188+
166189
- name: npm install
167190
run: |
168191
node --version
@@ -190,14 +213,22 @@ jobs:
190213
- name: Checkout Code
191214
uses: actions/checkout@v4
192215

193-
- name: Setup Node 20.10
216+
- name: Setup Node 20.16
194217
uses: actions/setup-node@v4
195218
with:
196-
node-version: '20.10'
219+
node-version: '20.16'
197220

198221
- name: Install Husky
199222
run: npm install --save-dev husky
200223

224+
- name: Change the package.json version if an RC tag
225+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
226+
run: |
227+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
228+
229+
jq ".version = \"${tag}\"" package.json > package.tmp
230+
mv package.tmp package.json
231+
201232
- name: npm install and build
202233
run: |
203234
node --version
@@ -258,29 +289,53 @@ jobs:
258289
echo "EXE_FILE=$EXE_FILE" >>$GITHUB_ENV
259290
echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV
260291
292+
# RC release should not be set as latest
293+
- name: Decide if release should be set as latest
294+
id: is_latest
295+
shell: bash
296+
run: |
297+
unset IS_LATEST
298+
299+
echo "Github ref is $GITHUB_REF"
300+
301+
if [[ "$GITHUB_REF" =~ "-rc" ]]; then
302+
echo "release candidate tag matched"
303+
IS_LATEST='false'
304+
IS_PRERELEASE='true'
305+
else
306+
echo "main branch release matched"
307+
IS_LATEST='true'
308+
IS_PRERELEASE='false'
309+
fi
310+
311+
echo "IS_LATEST=${IS_LATEST}" >> "$GITHUB_OUTPUT"
312+
echo "IS_PRERELEASE=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT"
313+
261314
- name: Release
262-
uses: softprops/action-gh-release@v0.1.15
315+
uses: softprops/action-gh-release@v2
263316
with:
317+
prerelease: ${{steps.is_latest.outputs.IS_PRERELEASE}}
318+
make_latest: "${{steps.is_latest.outputs.IS_LATEST}}"
264319
files: |
265320
${{ env.DMG_FILE }}
266321
${{ env.DEB_FILE }}
267322
${{ env.EXE_FILE }}
268323
${{ env.WEB_FILE }}
269324
270325
- name: Get repo name
326+
if: startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
271327
id: repo-name
272328
run: |
273329
echo "REPO_NAME=$(echo "$GITHUB_REPOSITORY" | cut -d "/" -f 2)" >>$GITHUB_OUTPUT
274330
275331
- name: Get tag name
332+
if: startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
276333
id: tag-name
277334
run: |
278335
echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT
279336
280-
- name: Gets JWT Token from GitHub
281-
uses: Chia-Network/actions/github/jwt@main
282-
283337
- name: Trigger apt repo update
338+
if: startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
284339
uses: Chia-Network/actions/github/glue@main
285340
with:
286341
json_data: '{"climate_tokenization_repo":"${{ steps.repo-name.outputs.REPO_NAME }}","application_name":"[\"${{ env.APP_NAME }}\"]","release_version":"${{ steps.tag-name.outputs.TAGNAME }}","add_debian_version":"true","arm64":"available"}'

app-builds.js

-18
This file was deleted.

app-builds.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"cadt": {
3+
"tag": "2.0.1",
4+
"url": "https://github.com/Chia-Network/core-registry-cadt-ui/releases/download/{{tag}}/core-registry-cadt-ui-web-build.tar.gz"
5+
},
6+
"climate_explorer": {
7+
"tag": "1.2.2",
8+
"url": "https://github.com/Chia-Network/climate-explorer-ui/releases/download/{{tag}}/climate-explorer-ui-web-build.tar.gz"
9+
},
10+
"climate_tokenization_engine": {
11+
"tag": "1.2.2",
12+
"url": "https://github.com/Chia-Network/Climate-Tokenization-Engine-UI/releases/download/{{tag}}/climate-tokenization-engine-ui-web-build.tar.gz"
13+
},
14+
"climate_dashboard": {
15+
"tag": "1.0.2",
16+
"url": "https://github.com/Chia-Network/core-registry-dashboard-ui/releases/download/{{tag}}/core-registry-dashboard-ui-web-build.tar.gz"
17+
}
18+
}

0 commit comments

Comments
 (0)