Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🔧 update publish config to handle draft releases #1353

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,48 @@ jobs:
CYPRESS_INSTALL_BINARY: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile
- name: Publish release

- 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 "sdp.devs@dpc.vic.gov.au"
git config --global user.name "SDP Deploy"

- 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.ref }} # Pushes back to the same 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: |
git config --global user.email "sdp.devs@dpc.vic.gov.au"
git config --global user.name "SDP Deploy"
pnpm config set access public
pnpm run release:publish --yes