-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Chia-Network/develop
Release 1.0
- Loading branch information
Showing
5 changed files
with
144 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 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 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: main-release-check | ||
|
||
jobs: | ||
check-version: | ||
name: Tag and Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clean workspace | ||
uses: Chia-Network/actions/clean-workspace@main | ||
|
||
- name: Checkout current branch | ||
uses: actions/checkout@v3 | ||
with: | ||
# Need PACKAGE_ADMIN_PAT token so when the tag is created, the tag automation runs | ||
token: ${{ secrets.PACKAGE_ADMIN_PAT }} | ||
fetch-depth: 0 | ||
|
||
- name: Configure 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 | ||
run: | | ||
version=$(cat $GITHUB_WORKSPACE/package.json | jq -r '.version') | ||
echo "Version is: $version" | ||
if [ $(git tag -l "$version") ]; then | ||
echo "Tag exists, nothing to do" | ||
else | ||
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 add CHANGELOG.md | ||
git commit -m "chore: Updating changelog for $version" | ||
git tag $version -m "Release $version \n$changes" | ||
git push origin $version | ||
git push origin main | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This workflow runs on any PRs that are targeting main, and ensures that the version in package.json is incremented | ||
name: Check Version Increment | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
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 || '' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-version: | ||
name: Check version increment | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Chia-Network/actions/clean-workspace@main | ||
|
||
- name: Checkout current branch | ||
uses: actions/checkout@v3 | ||
with: | ||
path: branch-repo | ||
|
||
- name: Checkout main | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
path: main-repo | ||
|
||
- name: Check Versions | ||
run: | | ||
main_version=$(cat $GITHUB_WORKSPACE/main-repo/package.json | jq -r '.version') | ||
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 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Publish to NPM | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18" | ||
|
||
- name: Publish to NPM | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc | ||
npm publish --access public | ||
- name: Cleanup | ||
if: always() | ||
run: rm .npmrc || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
{ | ||
"name": "core-registry-logger", | ||
"name": "@chia-carbon/core-registry-logger", | ||
"version": "1.0.0", | ||
"description": "Custom logger for core registry projects", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "Michael Taylor", | ||
"license": "ISC", | ||
"author": "Chia Network", | ||
"email": "[email protected]", | ||
"url": "https://www.chia.net/", | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Chia-Network/core-registry-logger.git" | ||
}, | ||
"bugs":{ | ||
"url": "https://github.com/Chia-Network/core-registry-logger/issues" | ||
}, | ||
"dependencies": { | ||
"chia-root-resolver": "^1.0.0", | ||
"winston": "^3.10.0", | ||
"winston-daily-rotate-file": "^4.7.1" | ||
} | ||
}, | ||
"contributors": [ | ||
"Michael.Taylor <[email protected]>", | ||
"Chris Marslender <[email protected]>", | ||
"Zach Brown <[email protected]>" | ||
] | ||
} |