Skip to content

Commit

Permalink
ci: modify release job (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborux authored May 8, 2023
1 parent 3013595 commit 492988c
Showing 1 changed file with 42 additions and 10 deletions.
52 changes: 42 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
task: [ lint, 'test:unit', 'test:unit-cypress', 'test:e2e:ci' ]
task: [lint, 'test:unit', 'test:unit-cypress', 'test:e2e:ci']
name: ${{ matrix.task }}
container:
image: cypress/browsers:node-18.16.0-chrome-112.0.5615.121-1-ff-112.0.1-edge-112.0.1722.48-1
Expand Down Expand Up @@ -60,26 +60,58 @@ jobs:
with:
path: |
node_modules/.cache
key: lerna-cache-${{github.sha}}-${{matrix.task}}
key: lerna-cache-${{matrix.task}}-${{github.sha}}
restore-keys: |
lerna-cache-${{github.sha}}
lerna-cache-
lerna-cache-${{matrix.task}}
- name: install dependencies
run: pnpm install

- name: Run ${{ matrix.task }}
run: npm run ${{ matrix.task }}

release:
needs: [ build ]
if:
${{ github.ref_name == 'main' && github.actor != 'support-empathy' &&
!startsWith(github.event.head_commit.message, 'chore(release):') }}
needs: [build]
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
# Install pnpm because it is not included in our container image
- name: install pnpm
uses: pnpm/action-setup@v2
with:
version: 7

- name: setup pnpm cache
id: pnpm-cache
uses: actions/cache@v3
with:
path: |
${{ steps.setup-env-vars.outputs.PNPM_STORE_PATH }}
${{ steps.setup-env-vars.outputs.CYPRESS_CACHE_FOLDER }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: setup lerna cache
id: lerna-cache
uses: actions/cache/restore@v3
with:
path: |
node_modules/.cache
restore-keys: |
lerna-cache-
- name: install dependencies
run: pnpm install

- name: Release alpha on non-release pushes to main branch
if:
${{ github.ref_name == 'main' && github.actor != 'support-empathy' &&
!startsWith(github.event.head_commit.message, 'chore(release):') }}
uses: ./.github/actions/release-alpha
with:
npm_token: ${{ secrets.NPM_TOKEN }}
github_token: ${{ secrets.SUPPORT_TOKEN }}
github_token: ${{ secrets.SUPPORT_TOKEN }}

0 comments on commit 492988c

Please sign in to comment.