-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d974b04
commit 56668ce
Showing
6 changed files
with
390 additions
and
46 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 |
---|---|---|
|
@@ -19,7 +19,20 @@ commands: | |
keys: | ||
- v1-dependencies-{{ arch }}-{{ checksum "package-lock.json" }} | ||
- v1-dependencies-{{ arch }} | ||
- run: npm install | ||
- when: | ||
condition: << pipeline.git.tag >> | ||
steps: | ||
- run: | ||
name: Update Version | ||
command: node script/update-version.js << pipeline.git.tag >> | ||
- run: npm install | ||
- unless: | ||
condition: << pipeline.git.tag >> | ||
steps: | ||
- run: | ||
command: npm install | ||
environment: | ||
ELECTRON_CHROMEDRIVER_STABLE_FALLBACK: 1 | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
|
@@ -65,6 +78,32 @@ jobs: | |
- install: | ||
node-version: << parameters.node-version >> | ||
- test | ||
release: | ||
docker: | ||
- image: cimg/node:18.14 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Update Version | ||
command: node script/update-version.js << pipeline.git.tag >> | ||
- run: | ||
name: Install Dependencies | ||
command: npm ci | ||
- run: | ||
name: Obtain Publishing Credentials | ||
command: npx @continuous-auth/[email protected] | ||
- run: | ||
name: Confirm Version Updated | ||
command: node -e "if (require('./package.json').version === '0.0.0-development') process.exit(1)" | ||
- run: | ||
name: Set NPM Credentials | ||
command: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc | ||
- run: | ||
name: Check NPM Credentials | ||
command: npm whoami | ||
- run: | ||
name: CFA Publish | ||
command: node script/publish.js | ||
|
||
workflows: | ||
test_and_release: | ||
|
@@ -76,17 +115,43 @@ workflows: | |
- 18.14.0 | ||
- 16.19.0 | ||
- 14.19.0 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- test-mac: | ||
matrix: | ||
parameters: | ||
node-version: | ||
- 18.14.0 | ||
- 16.19.0 | ||
- 14.19.0 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- test-windows: | ||
matrix: | ||
parameters: | ||
node-version: | ||
- 18.14.0 | ||
- 16.19.0 | ||
- 14.19.0 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- release: | ||
requires: | ||
- test-linux-18.14.0 | ||
- test-linux-16.19.0 | ||
- test-linux-14.19.0 | ||
- test-mac-18.14.0 | ||
- test-mac-16.19.0 | ||
- test-mac-14.19.0 | ||
- test-windows-18.14.0 | ||
- test-windows-16.19.0 | ||
- test-windows-14.19.0 | ||
filters: | ||
tags: | ||
only: /^v.*/ | ||
branches: | ||
ignore: /.*/ | ||
context: cfa-release |
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 |
---|---|---|
|
@@ -11,13 +11,14 @@ env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
run_tests: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
smoke_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag: v3.3.0 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag: v3.6.0 | ||
with: | ||
node-version: "16.19.0" | ||
- name: Update Version | ||
run: node script/update-version.js ${{ github.event.inputs.version }} | ||
- name: Install Dependencies | ||
|
@@ -26,37 +27,14 @@ jobs: | |
run: npm test | ||
create_new_version: | ||
runs-on: ubuntu-latest | ||
needs: run_tests | ||
needs: smoke_test | ||
steps: | ||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # tag: v3.3.0 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # tag: v3.6.0 | ||
with: | ||
node-version: lts/* | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Check npm credentials | ||
run: npm whoami | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
- name: Set Git Credentials | ||
run: | | ||
git config user.name electron-bot | ||
git config user.email [email protected] | ||
- name: Update Version | ||
run: node script/update-version.js ${{ github.event.inputs.version }} | ||
- name: Push Update Commit | ||
run: | | ||
git add . | ||
git commit -m "chore: update version to ${{ github.event.inputs.version }}" | ||
git push origin main | ||
# Tag here, the CircleCI workflow will trigger on the new tag and do the CFA publish | ||
- name: Push New Tag | ||
run: | | ||
git tag ${{ github.event.inputs.version }} | ||
git push origin ${{ github.event.inputs.version }} | ||
- name: Create Release | ||
run: | | ||
gh release create ${{ github.event.inputs.version }} -t ${{ github.event.inputs.version }} | ||
- name: Publish to npm | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_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
Oops, something went wrong.