Skip to content

Commit beca6a9

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents d43a4e0 + db3f13e commit beca6a9

13 files changed

+251
-108
lines changed

.github/dependabot.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ updates:
99
interval: "weekly"
1010
day: "tuesday"
1111
open-pull-requests-limit: 10
12+
rebase-strategy: auto
1213
labels:
1314
- dependencies
1415
- go
@@ -25,18 +26,20 @@ updates:
2526
interval: "weekly"
2627
day: "tuesday"
2728
open-pull-requests-limit: 10
29+
rebase-strategy: auto
2830
labels:
2931
- dependencies
3032
- python
3133
- "Changed"
3234
reviewers: ["emlowe", "altendky"]
3335

3436
- package-ecosystem: "github-actions"
35-
directory: /
37+
directories: ["/", ".github/actions/*"]
3638
schedule:
3739
interval: "weekly"
3840
day: "tuesday"
3941
open-pull-requests-limit: 10
42+
rebase-strategy: auto
4043
labels:
4144
- dependencies
4245
- github_actions
@@ -49,6 +52,7 @@ updates:
4952
interval: "weekly"
5053
day: "tuesday"
5154
open-pull-requests-limit: 10
55+
rebase-strategy: auto
5256
labels:
5357
- dependencies
5458
- javascript
@@ -61,6 +65,7 @@ updates:
6165
interval: "weekly"
6266
day: "tuesday"
6367
open-pull-requests-limit: 10
68+
rebase-strategy: auto
6469
labels:
6570
- dependencies
6671
- rust

.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/auto-release.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@ jobs:
1515
name: Check version increment
1616
runs-on: ubuntu-latest
1717
steps:
18-
- name: Clean workspace
19-
uses: Chia-Network/actions/clean-workspace@main
20-
2118
- name: Checkout current branch
2219
uses: actions/checkout@v4
2320
with:
24-
# Need PACKAGE_ADMIN_PAT token so when the tag is created, the tag automation runs
25-
token: ${{ secrets.PACKAGE_ADMIN_PAT }}
21+
# Need REPO_COMMIT token so when the tag is created, the tag automation runs
22+
token: ${{ secrets.REPO_COMMIT }}
2623
fetch-depth: 0
2724

2825
- name: Setup commit signing for ChiaAutomation

.github/workflows/build-installers.yaml

+79-11
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ on:
99
- '**'
1010

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

15+
1616
permissions:
1717
id-token: write
1818
contents: write
@@ -22,8 +22,6 @@ jobs:
2222
name: Build Mac Installer
2323
runs-on: macos-latest
2424
steps:
25-
- uses: Chia-Network/actions/clean-workspace@main
26-
2725
- name: Checkout Code
2826
uses: actions/checkout@v4
2927

@@ -38,6 +36,17 @@ jobs:
3836
- name: install dmg-license
3937
run: npm i dmg-license
4038

39+
- name: Change the package.json version if an RC tag
40+
shell: bash
41+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
42+
run: |
43+
echo "Github ref: $GITHUB_REF"
44+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
45+
echo "Extracted tag is $tag"
46+
47+
jq ".version = \"${tag}\"" package.json > package.tmp
48+
mv package.tmp package.json
49+
4150
- name: npm install
4251
run: |
4352
npm install
@@ -51,10 +60,10 @@ jobs:
5160
if [ -n "$SIGNING_SECRET" ]; then HAS_SIGNING_SECRET='true' ; fi
5261
echo "HAS_SIGNING_SECRET=${HAS_SIGNING_SECRET}" >> "$GITHUB_OUTPUT"
5362
env:
54-
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
55-
63+
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
64+
5665
- name: Import Apple installer signing certificate
57-
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET
66+
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET && startsWith(github.ref, 'refs/tags/') && startsWith(github.ref, 'refs/tags/')
5867
uses: Apple-Actions/import-codesign-certs@v3
5968
with:
6069
p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }}
@@ -66,7 +75,7 @@ jobs:
6675
run: npm run electron:package:mac
6776

6877
- name: Notarize
69-
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET
78+
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET && startsWith(github.ref, 'refs/tags/')
7079
run: |
7180
DMG_FILE=$(find ${{ github.workspace }}/dist/ -type f -name '*.dmg')
7281
xcrun notarytool submit \
@@ -100,6 +109,17 @@ jobs:
100109
- name: Ignore Husky where not compatible
101110
run: npm pkg delete scripts.prepare
102111

112+
- name: Change the package.json version if an RC tag
113+
shell: bash
114+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
115+
run: |
116+
echo "Github ref: $GITHUB_REF"
117+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
118+
echo "Extracted tag is $tag"
119+
120+
jq ".version = \"${tag}\"" package.json > package.tmp
121+
mv package.tmp package.json
122+
103123
- name: npm install
104124
run: |
105125
node --version
@@ -117,8 +137,8 @@ jobs:
117137
if [ -n "$SIGNING_SECRET" ]; then HAS_SIGNING_SECRET='true' ; fi
118138
echo "HAS_SIGNING_SECRET=${HAS_SIGNING_SECRET}" >> "$GITHUB_OUTPUT"
119139
env:
120-
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
121-
140+
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
141+
122142
# Windows Code Signing
123143
- name: Get installer name for signing
124144
shell: bash
@@ -158,6 +178,17 @@ jobs:
158178
- name: Install Husky
159179
run: npm install --save-dev husky
160180

181+
- name: Change the package.json version if an RC tag
182+
shell: bash
183+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
184+
run: |
185+
echo "Github ref: $GITHUB_REF"
186+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
187+
echo "Extracted tag is $tag"
188+
189+
jq ".version = \"${tag}\"" package.json > package.tmp
190+
mv package.tmp package.json
191+
161192
- name: npm install
162193
run: |
163194
node --version
@@ -167,6 +198,7 @@ jobs:
167198
run: npm run electron:package:linux
168199

169200
- name: Rename Linux installer to be standard format for apt
201+
shell: bash
170202
run: |
171203
ORIGINAL=$(ls dist/*.deb)
172204
MODIFIED=${ORIGINAL:0:-10}-1${ORIGINAL#${ORIGINAL:0:-10}}
@@ -193,6 +225,17 @@ jobs:
193225
- name: Install Husky
194226
run: npm install --save-dev husky
195227

228+
- name: Change the package.json version if an RC tag
229+
shell: bash
230+
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
231+
run: |
232+
echo "Github ref: $GITHUB_REF"
233+
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
234+
echo "Extracted tag is $tag"
235+
236+
jq ".version = \"${tag}\"" package.json > package.tmp
237+
mv package.tmp package.json
238+
196239
- name: npm install and build
197240
run: |
198241
node --version
@@ -253,9 +296,33 @@ jobs:
253296
echo "EXE_FILE=$EXE_FILE" >>$GITHUB_ENV
254297
echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV
255298
299+
# RC release should not be set as latest
300+
- name: Decide if release should be set as latest
301+
id: is_latest
302+
shell: bash
303+
run: |
304+
unset IS_LATEST
305+
306+
echo "Github ref is $GITHUB_REF"
307+
308+
if [[ "$GITHUB_REF" =~ "-rc" ]]; then
309+
echo "release candidate tag matched"
310+
IS_LATEST='false'
311+
IS_PRERELEASE='true'
312+
else
313+
echo "main branch release matched"
314+
IS_LATEST='true'
315+
IS_PRERELEASE='false'
316+
fi
317+
318+
echo "IS_LATEST=${IS_LATEST}" >> "$GITHUB_OUTPUT"
319+
echo "IS_PRERELEASE=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT"
320+
256321
- name: Release
257-
uses: softprops/action-gh-release@v2.1.0
322+
uses: softprops/action-gh-release@v2
258323
with:
324+
prerelease: ${{steps.is_latest.outputs.IS_PRERELEASE}}
325+
make_latest: "${{steps.is_latest.outputs.IS_LATEST}}"
259326
files: |
260327
${{ env.DMG_FILE }}
261328
${{ env.DEB_FILE }}
@@ -268,6 +335,7 @@ jobs:
268335
echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT
269336
270337
- name: Trigger apt repo update
338+
if: startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
271339
uses: Chia-Network/actions/github/glue@main
272340
with:
273341
json_data: '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}'

.github/workflows/ensure-version-increment.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
name: Check version increment
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: Chia-Network/actions/clean-workspace@main
20-
2119
- name: Checkout current branch
2220
uses: actions/checkout@v4
2321
with:
@@ -35,7 +33,7 @@ jobs:
3533
branch_version=$(cat $GITHUB_WORKSPACE/branch-repo/package.json | jq -r '.version')
3634
echo "Main version: $main_version"
3735
echo "Branch version: $branch_version"
38-
36+
3937
if [[ "$branch_version" == "$main_version" ]]; then
4038
echo "Version in package.json on this branch is not changing. Version must incremenet for a merge to main"
4139
exit 1

0 commit comments

Comments
 (0)