-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates publish from npm -> yarn, and FIO-7848
- Loading branch information
1 parent
4485fce
commit e0fa4dc
Showing
1 changed file
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Build / Test / Publish | ||
name: Build, Test, Publish | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
types: [opened, synchronize, reopened] | ||
|
||
env: | ||
NODE_VERSION: 18.x | ||
|
@@ -56,7 +56,7 @@ jobs: | |
with: | ||
cmd: build | ||
|
||
test: | ||
test-current: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -76,8 +76,45 @@ jobs: | |
with: | ||
cmd: test | ||
|
||
test-target: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code ${{ github.repository }} on ${{ github.ref }} | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Merge target branch into current branch | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "pkgbot" | ||
git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} | ||
git merge ${{ github.event.pull_request.base.ref }} --no-commit --no-ff | ||
if ! git merge --no-commit --no-ff ${{ github.event.pull_request.base.ref }}; then | ||
echo "Merge conflicts detected." | ||
git merge --abort | ||
exit 1 | ||
else | ||
echo "Merge successful." | ||
fi | ||
- name: Restore node modules from cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Test | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: test | ||
|
||
publish: | ||
needs: [setup, test] | ||
needs: [setup, test-current, test-target] | ||
if: ${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -144,4 +181,4 @@ jobs: | |
- name: Publish to npm | ||
run: | | ||
npm version $NEW_VERSION | ||
npm publish --tag dev | ||
yarn publish --tag dev |