Forms Release #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Forms Release' | |
on: | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
name: Checkout [master] | |
with: | |
ref: 'master' | |
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: 'master' | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
cache: yarn | |
- name: Install | |
shell: bash | |
run: yarn install --frozen-lockfile --non-interactive --no-progress --prefer-offline | |
- name: Commit lint | |
shell: bash | |
run: yarn commitlint --from=last-release | |
- name: Lint | |
run: yarn nx affected:lint --base=last-release | |
- name: Build | |
run: yarn nx affected:build --base=last-release | |
- name: Unit tests | |
run: yarn nx affected:test --base=last-release --code-coverage | |
- name: Codecov upload | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: 'master' | |
fetch-depth: 0 | |
- uses: actions/setup-node@v2 | |
with: | |
cache: yarn | |
node-version: "14" | |
registry-url: https://registry.npmjs.org | |
- run: yarn install --frozen-lockfile --non-interactive --no-progress --prefer-offline | |
- name: Setup git user to "🤖 Release Bot" | |
run: git config user.email "-" && git config user.name "🤖 Release Bot" | |
- name: Version | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Use npx instead of yarn because yarn auto-magically sets NPM_* environment variables | |
# like NPM_CONFIG_REGISTRY so npm publish ends up ignoring the .npmrc file | |
# which is set up by `setup-node` action. | |
# run: npx nx affected --base=master --releaseAs=minor --target=version | |
run: npx --no-install nx run workspace:version --baseBranch=master --syncVersions | |
- name: Tag last release | |
run: git tag -f last-release | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
force: true | |
tags: true |