-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nx-plugin): Release automation (#129)
* Set up release-please and clean up workflows * Remove extra whitespace caused by generator templates * Set default parameters when running license generator * Release generator * Use readJson instead of readNxJson as we want just the contents in the repo, not the fully resolved config * Fix reading generator defaults + use generator-written formatting for release-please-config * Add release generator to generators.json * Fix no-publish release workflow * Fix lockfile * Add to release-please-config.json * Add canary release handling
- Loading branch information
Showing
35 changed files
with
17,936 additions
and
6,782 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
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
releases_created: ${{ steps.prep-release.outputs.releases_created }} | ||
steps: | ||
- name: Prep release | ||
id: prep-release | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
command: manifest | ||
|
||
update-lockfile: | ||
name: Update release PR with lockfile updates | ||
runs-on: ubuntu-latest | ||
needs: release-please | ||
if: needs.release-please.outputs.releases_created != 'true' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: release-please--branches--main | ||
fetch-depth: 2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- name: Update package-lock.json | ||
run: npm install --no-audit --no-fund --ignore-scripts --package-lock-only | ||
- name: Merge changes with last commit | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit --amend --no-edit | ||
git push -f | ||
npm-publish: | ||
needs: release-please | ||
if: ${{ needs.release-please.outputs.releases_created }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Use the node_modules cache if available | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}- | ||
- run: npm ci | ||
- run: npm publish -ws --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
|
||
canary-release: | ||
name: Release canary versions to NPM | ||
runs-on: ubuntu-latest | ||
needs: release-please | ||
if: needs.release-please.outputs.releases_created != 'true' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
- name: Use the node_modules cache if available | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-${{ steps.versions.outputs.node_version }}- | ||
- run: npm ci | ||
- run: npx lerna publish --yes | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
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 @@ | ||
{} |
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,9 @@ | ||
{ | ||
"$schema": "node_modules/lerna/schemas/lerna-schema.json", | ||
"useNx": true, | ||
"useWorkspaces": true, | ||
"version": "independent", | ||
"canary": true, | ||
"preid": "dev", | ||
"preDistTag": "canary" | ||
} |
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
Oops, something went wrong.