Skip to content

Commit

Permalink
Enable CI create prerelease version
Browse files Browse the repository at this point in the history
  • Loading branch information
limzykenneth committed Jan 17, 2024
1 parent 626bdc9 commit b2da2ed
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
push:
tags:
- 'v*.*.*' # Push events to matching v*.*.*, i.e. v20.15.10
- 'v*.*.*-*' # Push events to matching v*.*.*-*, i.e. v20.15.10-0

jobs:
release:
Expand All @@ -21,11 +22,18 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Get semver info
id: semver
uses: akshens/semver-tag@v4
with:
version: ${{ github.ref_name }}

- name: Get version number
id: version-number
run: |
version=$(echo ${{ github.ref_name }} | cut -c 2-)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +"%B %Oe, %Y")" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -56,16 +64,19 @@ jobs:
uses: softprops/[email protected]
with:
draft: true
prerelease: ${{ steps.semver.outputs.is-prerelease == 'true' }}
files: release/*
generate_release_notes: true
token: ${{ secrets.ACCESS_TOKEN }}
- name: Publish to NPM
if: ${{ steps.semver.outputs.is-prerelease != 'true' }}
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

# 4. Update website files
- name: Checkout website repo
if: ${{ steps.semver.outputs.is-prerelease != 'true' }}
uses: actions/checkout@v3
with:
repository: processing/p5.js-website
Expand Down Expand Up @@ -111,6 +122,7 @@ jobs:

# 5. Update Bower files
- name: Checkout Bower repo
if: ${{ steps.semver.outputs.is-prerelease != 'true' }}
uses: actions/checkout@v3
with:
repository: processing/p5.js-release
Expand Down

0 comments on commit b2da2ed

Please sign in to comment.