Skip to content

Commit

Permalink
set up pre-release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart committed Sep 18, 2024
1 parent c209bd1 commit 9754c7d
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
workflow_call:
inputs:
nonce:
type: string
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Restore cached build files
uses: actions/cache@v4
with:
key: ${{ inputs.nonce }}
path: |
./css/dist
./icon-registry/dist
./components
./node_modules
- name: Install Dependencies
run: yarn install --frozen-lockfile
env:
CI: true

- name: Set committer info
## attribute the commit to cypress-bot: https://github.community/t/logging-into-git-as-a-github-app/115916
run: |
git config --local user.email "${{ secrets.CYPRESS_BOT_APP_ID }}+cypress-bot[bot]@users.noreply.github.com"
git config --local user.name "cypress-bot[bot]"
- name: Configure .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Set version numbers
run: node scripts/set-version.mjs

- name: Run pre-release process with changeset
run: |
yarn changeset pre enter next
yarn changeset version
yarn changeset publish
9 changes: 9 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,12 @@ jobs:
secrets: inherit
with:
nonce: ${{ needs.make-nonce.outputs.nonce }}

release-next:
name: Release Next
if: github.ref == 'refs/heads/next' && github.event_name == 'push'
needs: [build, make-nonce, test, e2e-test, template-test]
uses: ./.github/workflows/release-next.yml
secrets: inherit
with:
nonce: ${{ needs.make-nonce.outputs.nonce }}

0 comments on commit 9754c7d

Please sign in to comment.