Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wwills2 committed Jan 9, 2025
2 parents d43a4e0 + db3f13e commit beca6a9
Show file tree
Hide file tree
Showing 13 changed files with 251 additions and 108 deletions.
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ updates:
interval: "weekly"
day: "tuesday"
open-pull-requests-limit: 10
rebase-strategy: auto
labels:
- dependencies
- go
Expand All @@ -25,18 +26,20 @@ updates:
interval: "weekly"
day: "tuesday"
open-pull-requests-limit: 10
rebase-strategy: auto
labels:
- dependencies
- python
- "Changed"
reviewers: ["emlowe", "altendky"]

- package-ecosystem: "github-actions"
directory: /
directories: ["/", ".github/actions/*"]
schedule:
interval: "weekly"
day: "tuesday"
open-pull-requests-limit: 10
rebase-strategy: auto
labels:
- dependencies
- github_actions
Expand All @@ -49,6 +52,7 @@ updates:
interval: "weekly"
day: "tuesday"
open-pull-requests-limit: 10
rebase-strategy: auto
labels:
- dependencies
- javascript
Expand All @@ -61,6 +65,7 @@ updates:
interval: "weekly"
day: "tuesday"
open-pull-requests-limit: 10
rebase-strategy: auto
labels:
- dependencies
- rust
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/auto-release-rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Compares the version in package.json to tags on the repo. If the tag doesn't exist, a new tag is created, which
# then triggers the normal "on tag" release automation in the build job
name: Auto Tag RC

on:
push:
branches:
- develop

concurrency:
group: rc-release-check

jobs:
release-dev:
name: Release rc version
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v4
with:
# Need REPO_COMMIT token so when the tag is created, the tag automation runs
token: ${{ secrets.REPO_COMMIT }}
fetch-depth: 0

- name: Setup commit signing for ChiaAutomation
uses: Chia-Network/actions/commit-sign/gpg@main
with:
gpg_private_key: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_KEY }}
passphrase: ${{ secrets.CHIA_AUTOMATION_PRIVATE_GPG_PASSPHRASE }}

- name: Check for current version tag. Create if it doesn't exist
env:
GH_TOKEN: ${{ github.token }}
run: |
stable_version=$(gh release list --limit 1 --order desc --exclude-pre-releases --json tagName --jq ".[].tagName")
echo "Latest release is $stable_version"
rc_version=$(gh release list --json tagName --jq ".[] | select(.tagName | test(\"${version}-rc*\")) | .tagName")
echo "Latest release candidate is $rc_version"
if [[ -z ${rc_version} ]]; then
# Extract the major, minor, and patch versions
IFS='.' read -r major minor patch <<< "$stable_version"
# Increment the patch version
new_patch=$((patch + 1))
# Construct the new version string
version="$major.$minor.$new_patch-rc1"
echo "New version: $version"
else
# Extract the major, minor, patch, and rc parts
IFS='.-' read -r major minor patch rc <<< "$rc_version"
# Extract just the number of the rc
rc_number="${rc#rc}"
# Increment the rc number
rc_number=$((rc_number +1))
# Construct the new version string
version="$major.$minor.$patch-rc$rc_number"
echo "New version: $version"
fi
if [ $(git tag -l "$version") ]; then
echo "$version tag exists, deleting..."
git tag -d $version
git push --delete origin $version
fi
echo "Tag does not exist. Creating and pushing tag"
rm -f CHANGELOG.md
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0
changes=$(npx conventional-changelog-cli -r 1 | tail -n +2)
git tag $version -m "Release $version $changes"
git push origin $version
7 changes: 2 additions & 5 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ jobs:
name: Check version increment
runs-on: ubuntu-latest
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main

- name: Checkout current branch
uses: actions/checkout@v4
with:
# Need PACKAGE_ADMIN_PAT token so when the tag is created, the tag automation runs
token: ${{ secrets.PACKAGE_ADMIN_PAT }}
# Need REPO_COMMIT token so when the tag is created, the tag automation runs
token: ${{ secrets.REPO_COMMIT }}
fetch-depth: 0

- name: Setup commit signing for ChiaAutomation
Expand Down
90 changes: 79 additions & 11 deletions .github/workflows/build-installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
- '**'

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


permissions:
id-token: write
contents: write
Expand All @@ -22,8 +22,6 @@ jobs:
name: Build Mac Installer
runs-on: macos-latest
steps:
- uses: Chia-Network/actions/clean-workspace@main

- name: Checkout Code
uses: actions/checkout@v4

Expand All @@ -38,6 +36,17 @@ jobs:
- name: install dmg-license
run: npm i dmg-license

- name: Change the package.json version if an RC tag
shell: bash
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
run: |
echo "Github ref: $GITHUB_REF"
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
echo "Extracted tag is $tag"
jq ".version = \"${tag}\"" package.json > package.tmp
mv package.tmp package.json
- name: npm install
run: |
npm install
Expand All @@ -51,10 +60,10 @@ jobs:
if [ -n "$SIGNING_SECRET" ]; then HAS_SIGNING_SECRET='true' ; fi
echo "HAS_SIGNING_SECRET=${HAS_SIGNING_SECRET}" >> "$GITHUB_OUTPUT"
env:
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"

- name: Import Apple installer signing certificate
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET
if: steps.check_secrets.outputs.HAS_SIGNING_SECRET && startsWith(github.ref, 'refs/tags/') && startsWith(github.ref, 'refs/tags/')
uses: Apple-Actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }}
Expand All @@ -66,7 +75,7 @@ jobs:
run: npm run electron:package:mac

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

- name: Change the package.json version if an RC tag
shell: bash
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
run: |
echo "Github ref: $GITHUB_REF"
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
echo "Extracted tag is $tag"
jq ".version = \"${tag}\"" package.json > package.tmp
mv package.tmp package.json
- name: npm install
run: |
node --version
Expand All @@ -117,8 +137,8 @@ jobs:
if [ -n "$SIGNING_SECRET" ]; then HAS_SIGNING_SECRET='true' ; fi
echo "HAS_SIGNING_SECRET=${HAS_SIGNING_SECRET}" >> "$GITHUB_OUTPUT"
env:
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"
SIGNING_SECRET: "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}"

# Windows Code Signing
- name: Get installer name for signing
shell: bash
Expand Down Expand Up @@ -158,6 +178,17 @@ jobs:
- name: Install Husky
run: npm install --save-dev husky

- name: Change the package.json version if an RC tag
shell: bash
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
run: |
echo "Github ref: $GITHUB_REF"
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
echo "Extracted tag is $tag"
jq ".version = \"${tag}\"" package.json > package.tmp
mv package.tmp package.json
- name: npm install
run: |
node --version
Expand All @@ -167,6 +198,7 @@ jobs:
run: npm run electron:package:linux

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

- name: Change the package.json version if an RC tag
shell: bash
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
run: |
echo "Github ref: $GITHUB_REF"
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
echo "Extracted tag is $tag"
jq ".version = \"${tag}\"" package.json > package.tmp
mv package.tmp package.json
- name: npm install and build
run: |
node --version
Expand Down Expand Up @@ -253,9 +296,33 @@ jobs:
echo "EXE_FILE=$EXE_FILE" >>$GITHUB_ENV
echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV
# RC release should not be set as latest
- name: Decide if release should be set as latest
id: is_latest
shell: bash
run: |
unset IS_LATEST
echo "Github ref is $GITHUB_REF"
if [[ "$GITHUB_REF" =~ "-rc" ]]; then
echo "release candidate tag matched"
IS_LATEST='false'
IS_PRERELEASE='true'
else
echo "main branch release matched"
IS_LATEST='true'
IS_PRERELEASE='false'
fi
echo "IS_LATEST=${IS_LATEST}" >> "$GITHUB_OUTPUT"
echo "IS_PRERELEASE=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT"
- name: Release
uses: softprops/action-gh-release@v2.1.0
uses: softprops/action-gh-release@v2
with:
prerelease: ${{steps.is_latest.outputs.IS_PRERELEASE}}
make_latest: "${{steps.is_latest.outputs.IS_LATEST}}"
files: |
${{ env.DMG_FILE }}
${{ env.DEB_FILE }}
Expand All @@ -268,6 +335,7 @@ jobs:
echo "TAGNAME=$(echo $GITHUB_REF | cut -d / -f 3)" >>$GITHUB_OUTPUT
- name: Trigger apt repo update
if: startsWith(github.ref, 'refs/tags/') && !contains( github.ref, '-rc')
uses: Chia-Network/actions/github/glue@main
with:
json_data: '{"cadt_repo":"cadt-ui","release_version":"${{ steps.tag-name.outputs.TAGNAME }}"}'
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ensure-version-increment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
name: Check version increment
runs-on: ubuntu-latest
steps:
- uses: Chia-Network/actions/clean-workspace@main

- name: Checkout current branch
uses: actions/checkout@v4
with:
Expand All @@ -35,7 +33,7 @@ jobs:
branch_version=$(cat $GITHUB_WORKSPACE/branch-repo/package.json | jq -r '.version')
echo "Main version: $main_version"
echo "Branch version: $branch_version"
if [[ "$branch_version" == "$main_version" ]]; then
echo "Version in package.json on this branch is not changing. Version must incremenet for a merge to main"
exit 1
Expand Down
Loading

0 comments on commit beca6a9

Please sign in to comment.