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

feat: add automated published branch releases for dev & main #10520

Merged
merged 13 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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