Skip to content

Release

Release #20

Workflow file for this run

name: Release
on:
pull_request:
branches:
- main
- next
- beta
- alpha
workflow_run:
workflows: ["CI"] # The name of the CI workflow
types:
- completed
permissions:
contents: read # for checkout
jobs:
release:
if: |
github.event_name == 'pull_request' &&
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/next' ||
github.ref == 'refs/heads/beta' ||
github.ref == 'refs/heads/alpha' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
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: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Note: Automatically populated GITHUB_TOKEN cannot be used if branch protection is enabled
# for the target branch. If the risk is acceptable, some extra configuration is needed. The
# actions/checkout persist-credentials option needs to be false, otherwise the generated
# GITHUB_TOKEN will interfere with the custom one.
# ref: https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md#pushing-packagejson-changes-to-your-repository
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@mitre-attack'
- name: Install
run: npm clean-install
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Upload test logs
uses: actions/upload-artifact@v4
if: always()
with:
name: test-logs
path: .test-logs/
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}