Skip to content

ci: add gh token

ci: add gh token #46

name: Release affected packages
on:
push:
branches:
- master
env:
HUSKY: 0
jobs:
main:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ github.workspace }}
strategy:
matrix:
node-version: [16.x]
steps:
- name: Set Node, yarn and npm versions
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
npm-version: 8.19.2
yarn-version: 1.22.4
- name: Checkout [Default Branch]
uses: actions/checkout@v2
if: ${{ github.event_name != 'pull_request' }}
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: ${{ github.base_ref }}
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: |
npx nx affected:test --base=origin/master~1 --head=origin/master
npx nx affected:build --base=origin/master~1 --head=origin/master
- name: Release packages
if: ${{ success() && (github.event_name != 'pull_request' || github.event.action == 'closed' && github.event.pull_request.merged == true) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npx nx affected --target=release --base=origin/master~1 --head=origin/master
npx semantic-release-plus