Skip to content

2.23.0

2.23.0 #130

Workflow file for this run

name: Publish
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9.0.6
run_install: false
- name: Install Node
uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com/'
node-version: 20
cache: 'pnpm'
scope: '@dpc-sdp'
- name: Install Dependencies
env:
CYPRESS_INSTALL_BINARY: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile
- name: Bump versions for proper release
if: ${{ !github.event.release.prerelease }}
run: npm run release:version ${{ github.event.release.name }} -- --yes
- name: Run release:changelog script for proper release
if: ${{ !github.event.release.prerelease }}
run: npm run release:changelog
- name: Configure Git
if: ${{ !github.event.release.prerelease }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "SDP Deploy"
git fetch origin ${{ github.event.release.target_commitish }}
git checkout ${{ github.event.release.target_commitish }}
- name: Commit changes
if: ${{ !github.event.release.prerelease }}
run: |
git add .
git commit -m "chore: release ${{ github.event.release.name }}"
- name: Push changes
if: ${{ !github.event.release.prerelease }}
run: |
git push origin ${{ github.event.release.target_commitish }} # Pushes back to target branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish draft release as alpha
if: ${{ github.event.release.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm config set access public
pnpm release:publish-alpha --yes
- name: Publish proper release
if: ${{ !github.event.release.prerelease }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm config set access public
pnpm run release:publish --yes