Skip to content

Commit

Permalink
Fixing release build (#220)
Browse files Browse the repository at this point in the history
* actions/checkout v2->v3

* CI bump task versions

* release-publish
  • Loading branch information
jvilimek committed Jan 21, 2024
1 parent f1e470d commit f51e26d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ jobs:
node-version: [20.x]
steps:
- name: Checkout non PR
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
# Do not trigger a checkout when opening PRs from a fork (helps avoid
# "pwn request". See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target )
if: github.event_name != 'pull_request_target'
with:
fetch-depth: '0'

- name: Checkout PR
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1
if: github.event_name == 'pull_request_target'
with:
ref: "refs/pull/${{ github.event.number }}/merge"
fetch-depth: '0'

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4.0.1
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --frozen-lockfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
4 changes: 2 additions & 2 deletions .github/workflows/release-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
node-version: [20.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.1

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4.0.1
with:
node-version: ${{ matrix.node-version }}

Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ jobs:
run: if [ '${{ github.event.before }}' = '0000000000000000000000000000000000000000' ]; then echo "::warning title=Missing github.event.before::You are running this CD workflow on a newly created branch. Release won't be created..."; fi

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1

- name: Set up Node.js
uses: actions/setup-node@v3
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth

- name: yarn install --frozen-lockfile
uses: backstage/actions/yarn-install@v0.5.13
uses: backstage/actions/yarn-install@v0.6.5
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}

Expand Down Expand Up @@ -76,9 +76,6 @@ jobs:
- name: verify type dependencies
run: yarn lint:type-deps

- name: test
run: |
yarn lerna -- run test -- --coverage --runInBand

# A separate release build that is only run for commits that are the result of merging the "Version Packages" PR
# We can't re-use the output from the above step, but we'll have a guaranteed node_modules cache and
Expand All @@ -100,16 +97,16 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1

- name: Set up Node.js
uses: actions/setup-node@v3
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth

- name: yarn install --frozen-lockfile
uses: backstage/actions/yarn-install@v0.5.13
uses: backstage/actions/yarn-install@v0.6.5
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}

Expand All @@ -123,10 +120,11 @@ jobs:
- name: publish
if: needs.build.outputs.needs_release == 'true' || github.event.inputs.publish_packages
run: |
yarn config set -H 'npmAuthToken' "${{secrets.NPM_TOKEN}}"
if [ -f ".changeset/pre.json" ]; then
yarn lerna -- publish from-package --yes --dist-tag next
yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish --tag next
else
yarn lerna -- publish from-package --yes
yarn workspaces foreach -v --no-private npm publish --access public --tolerate-republish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renovate-changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.actor == 'renovate[bot]'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
ref: ${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/renovate-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4.1.1
- name: Validate
uses: rinchsan/renovate-config-validator@v0.0.12
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/weekly-check-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4.1.1
with:
fetch-depth: '0'

Expand Down

0 comments on commit f51e26d

Please sign in to comment.