Skip to content

Commit

Permalink
Merge pull request #81 from Chia-Network/develop
Browse files Browse the repository at this point in the history
Release 1.0.3
  • Loading branch information
TheLastCicada authored Dec 18, 2024
2 parents 6395ae0 + 09a3929 commit 37170aa
Show file tree
Hide file tree
Showing 10 changed files with 1,152 additions and 1,405 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

23 changes: 0 additions & 23 deletions .eslintrc.cjs

This file was deleted.

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
3 changes: 0 additions & 3 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ 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:
Expand Down
41 changes: 38 additions & 3 deletions .github/workflows/build-installers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,25 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: Setup Node 20.10
- name: Setup Node 20.16
uses: actions/setup-node@v4
with:
node-version: '20.10'
node-version: '20.16'

- 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 @@ -69,8 +80,32 @@ jobs:
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.WEB_FILE }}
47 changes: 47 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { fixupConfigRules } from "@eslint/compat";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: ["**/dist", "**/*.config.js"],
}, ...fixupConfigRules(compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
)), {
plugins: {
"react-refresh": reactRefresh,
},

languageOptions: {
globals: {
...globals.browser,
},

parser: tsParser,
},

rules: {
"react-refresh/only-export-components": ["warn", {
allowConstantExport: true,
}],

"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-implicit-any-catch": "off",
"@typescript-eslint/ban-ts-comment": "off",
},
}];
Loading

0 comments on commit 37170aa

Please sign in to comment.