Release #431
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
dryRun: | |
type: boolean | |
default: true | |
required: false | |
description: 'Run in dry-run mode (no actual release)' | |
env: | |
node-version: 20.x | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
# Check permissions | |
- uses: tspascoal/get-user-teams-membership@v3 | |
id: permissions | |
with: | |
username: ${{ github.actor }} | |
team: 'ESL Core Maintainers' | |
GITHUB_TOKEN: ${{ secrets.PERMISSION_CHECK_TOKEN }} | |
- if: ${{ steps.permissions.outputs.isTeamMember == 'true' }} | |
name: Access Check Passed | |
run: echo ${{ github.actor }} is in 'ESL Core Maintainers' group | |
- if: ${{ steps.permissions.outputs.isTeamMember == 'false' }} | |
name: Access Denied | |
run: exit 1 | |
# Start workflow | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Use Node v${{ env.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
node-version: ${{ env.node-version }} | |
- name: Install NPM Dependencies | |
run: npm ci | |
- name: Run Semantic Release in Dry Run mode | |
if: ${{ inputs.dryRun }} | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
run: npx semantic-release --dry-run | |
- name: Run Semantic Release | |
if: ${{ !inputs.dryRun }} | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
run: npx semantic-release |