Skip to content

Commit

Permalink
ci(ga): update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gund committed Mar 24, 2024
1 parent d862589 commit 8a0c780
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment: 'Release NPM'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
RELEASE_BRANCH: ${{ github.event.workflow_run.head_branch }}
steps:
- uses: actions/setup-node@v2
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ env.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ env.RELEASE_BRANCH }}
- uses: actions/cache@v2
with:
Expand All @@ -41,18 +38,37 @@ jobs:
restore-keys: |
npm-node-
- name: Auth NPM
run: echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > ~/.npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Auth Git
run: |
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git config --global user.name 'GitHub Actions Bot'
- name: Install Deps
run: npm ci --ignore-scripts
- name: Release Latest
if: ${{ env.RELEASE_BRANCH == 'master' }}
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release Next
if: ${{ env.RELEASE_BRANCH == 'next' }}
run: RELEASE_TAG=next npm run release:tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release Branch
if: ${{ startsWith(env.RELEASE_BRANCH, 'release/') }}
run: RELEASE_BRANCH=\"${{ env.RELEASE_BRANCH }}\" npm run release:branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release Error Log
if: failure()
run: cat lerna-debug.log
- name: Post Auth NPM
if: always()
run: rm ~/.npmrc

0 comments on commit 8a0c780

Please sign in to comment.