Skip to content

Commit

Permalink
feat: add automated published branch releases for dev & main (#10520)
Browse files Browse the repository at this point in the history
* feat: add beta release workflow

* chore: rename beta release message from react-tooltip to pixi.js

* chore: refactor auto beta release to be publish branch

* chore: use npm cache instead of yarn cache

Co-authored-by: Matt Karl <matt@mattkarl.com>

* chore: refactor publish-branch.yaml to use shared setup

* Update .github/workflows/publish-branch.yaml

Co-authored-by: Matt Karl <matt@mattkarl.com>

* chore: refactor publish-branch workflow to handle the full workflow

* chore: remove unecessary line from publish-branch workflow

* chore: remove minimist package as it is not necessary anymore

* chore: remove npmrc setup from publish branch workflow

* chore: add npm run build into the publish workflow

---------

Co-authored-by: Matt Karl <matt@mattkarl.com>
  • Loading branch information
danielbarion and bigtimebuddy committed May 23, 2024
1 parent 8bec73b commit 141f7e0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/publish-branch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Branch

on:
push:
branches:
- main
- dev

jobs:
release_candidate:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Setup Project
uses: ./.github/actions/setup

- name: Build Project
run: npm run build

- name: Get current package.json version
run: echo "PACKAGE_VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_ENV

# get the sort SHA and add it into the environment variables
- name: Setup Branch Release Candidate Version
run: echo "BRANCH_VERSION=$PACKAGE_VERSION-$BRANCH_NAME.${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Bump version
run: npm version $BRANCH_VERSION --no-git-tag-version --force

- name: Publish a new branch release candidate version
run: npm publish --tag $BRANCH_NAME
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
"esbuild": "^0.19.0",
"eslint": "^8.38.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-no-mixed-operators": "^1.1.1",
"eslint-plugin-jsdoc": "^48.0.0",
"eslint-plugin-no-mixed-operators": "^1.1.1",
"fs-extra": "^11.2.0",
"glob": "^8.1.0",
"http-server": "^14.1.1",
Expand Down

0 comments on commit 141f7e0

Please sign in to comment.