docs: new root readme (#24) #37
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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | |
name: "Semantic Release" | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- "([0-9])?(.{+([0-9]),x}).x" | |
- "main" | |
- "next" | |
- "next-major" | |
- "alpha" | |
- "beta" | |
permissions: | |
contents: "read" # for checkout | |
jobs: | |
semantic-release: | |
name: "Semantic Release" | |
if: "github.repository == 'anolilab/semantic-release'" | |
runs-on: "ubuntu-latest" | |
permissions: | |
contents: "write" # to be able to publish a GitHub release | |
issues: "write" # to be able to comment on released issues | |
pull-requests: "write" # to be able to comment on released pull requests | |
id-token: "write" # to enable use of OIDC for npm provenance | |
steps: | |
- name: "Harden Runner" | |
uses: "step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142" # v2.7.0 | |
with: | |
egress-policy: "audit" | |
- name: "Wait for tests to succeed" | |
uses: "lewagon/wait-on-check-action@595dabb3acf442d47e29c9ec9ba44db0c6bdd18f" # v1.3.3 | |
timeout-minutes: 20 | |
with: | |
ref: "${{ github.event.pull_request.head.sha || github.sha }}" | |
repo-token: "${{ secrets.GITHUB_TOKEN }}" | |
wait-interval: 60 # seconds | |
running-workflow-name: "Semantic Release" # wait for all other checks to complete | |
allowed-conclusions: "success,skipped" # all other checks must pass, being skipped or cancelled is not sufficient | |
- name: "Git checkout" | |
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
env: | |
GIT_COMMITTER_NAME: "GitHub Actions Shell" | |
GIT_AUTHOR_NAME: "GitHub Actions Shell" | |
EMAIL: "github-actions[bot]@users.noreply.github.com" | |
- name: "Setup resources and environment" | |
id: "setup" | |
uses: "anolilab/workflows/step/setup@main" | |
with: | |
node-version: "18.x" | |
cache-prefix: "semantic-release" | |
- name: "Build Production" | |
run: "pnpm run build:packages:prod" | |
- name: "test and coverage" | |
run: "pnpm run test:coverage" | |
env: | |
TEST_PROD_BUILD: "true" | |
- name: "Prepare nx cache" | |
shell: "bash" | |
run: "tar -cf - .nx/cache | lz4 > /tmp/nx_cache.tar.lz4" # compress nx cache | |
- name: "Upload code coverage to codecov" | |
uses: "anolilab/workflows/step/codecov@main" | |
with: | |
run-lint: "false" | |
codecov-token: "${{ secrets.CODECOV_TOKEN }}" | |
- name: "Semantic Release" | |
if: "success()" | |
env: | |
GITHUB_TOKEN: "${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}" | |
NPM_TOKEN: "${{ secrets.NPM_AUTH_TOKEN }}" | |
GIT_AUTHOR_NAME: "github-actions-shell" | |
GIT_AUTHOR_EMAIL: "github-actions[bot]@users.noreply.github.com" | |
GIT_COMMITTER_NAME: "github-actions-shell" | |
GIT_COMMITTER_EMAIL: "github-actions[bot]@users.noreply.github.com" | |
run: "pnpm exec multi-semantic-release" |