Skip to content

Commit

Permalink
chore(repo): Clean up workflows (#2063)
Browse files Browse the repository at this point in the history
* chore(repo): Clean up workflows

* fix(repo): Add npx to changeset

* chore(repo): More consistency in release commands
  • Loading branch information
tmilewski authored Nov 6, 2023
1 parent cb7fa1d commit fa2b728
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/actions/init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,4 @@ runs:
- name: Install Playwright Browsers
if: inputs.playwright-enabled == 'true' && steps.playwright-cache.outputs.cache-hit != 'true'
shell: bash
run: npx playwright install --with-deps
run: npx playwright install chromium
6 changes: 4 additions & 2 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ jobs:
id: version-packages
run: npm run version:canary | tail -1 >> "$GITHUB_OUTPUT"

- name: Build release
run: npx turbo build $TURBO_ARGS --force # TODO: Remove --force, when appropriate

- name: Canary release
if: steps.version-packages.outputs.success == '1'
run: npx turbo build $TURBO_ARGS && changeset publish --tag canary --no-git-tag
run: npm run release:canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
TURBO_FORCE: true # TODO: Remove when comfortable

- name: Trigger workflows on related repos
uses: actions/github-script@v6
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ jobs:
id: version-packages
run: npm run version:snapshot ${{ steps.extract-snapshot-name.outputs.name }} | tail -1 >> "$GITHUB_OUTPUT"

- name: Build release
run: npx turbo build $TURBO_ARGS

- name: Snapshot release
if: steps.version-packages.outputs.success == '1'
run: npx turbo build $TURBO_ARGS && changeset publish --tag snapshot --no-git-tag
run: npm run release:snapshot
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
TURBO_FORCE: true # TODO: Remove when comfortable

- name: Package info
if: steps.version-packages.outputs.success == '1'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ jobs:
turbo-token: ${{ secrets.TURBO_TOKEN }}
playwright-enabled: true # Must be present to enable caching on branched workflows

- name: Build
run: npx turbo build $TURBO_ARGS
- name: Build release
run: npx turbo build $TURBO_ARGS --force

- name: Create Release PR
id: changesets
uses: changesets/action@v1
with:
commit: "chore(repo): Version packages"
publish: npx changeset publish && git push --follow-tags
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.CLERK_COOKIE_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"lint:publint": "FORCE_COLOR=1 turbo lint:publint",
"nuke": "./scripts/nuke.sh",
"prepare": "husky install",
"release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && changeset publish && git push --follow-tags",
"release:canary": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag canary --no-git-tag",
"release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag snapshot --no-git-tag",
"release": "changeset publish && git push --follow-tags",
"release:canary": "changeset publish --tag canary --no-git-tag",
"release:snapshot": "changeset publish --tag snapshot --no-git-tag",
"release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_CONCURRENCY=1 npm run build && changeset publish --no-git-tag; fi",
"test": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}",
"test:cache:clear": "FORCE_COLOR=1 turbo test:cache:clear --continue --concurrency=${TURBO_CONCURRENCY:-80%}",
Expand Down

0 comments on commit fa2b728

Please sign in to comment.