Skip to content

Commit

Permalink
Updates publish from npm -> yarn, and FIO-7848
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanformio committed Apr 3, 2024
1 parent 4485fce commit e0fa4dc
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions .github/workflows/publish.yml → .github/workflows/ci.yml
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
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
with:
cmd: build

test:
test-current:
needs: setup
runs-on: ubuntu-latest
steps:
Expand All @@ -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:
Expand Down Expand Up @@ -144,4 +181,4 @@ jobs:
- name: Publish to npm
run: |
npm version $NEW_VERSION
npm publish --tag dev
yarn publish --tag dev

0 comments on commit e0fa4dc

Please sign in to comment.