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

chore: reuse setup action #6659

Merged
merged 1 commit into from
Apr 11, 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
26 changes: 3 additions & 23 deletions .github/workflows/publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,33 +48,13 @@ jobs:
needs: tag
if: needs.tag.outputs.is_rc == 'true'
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needs full depth for changelog generation
- uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only thing missing would be this check. Could you pass this down to the action as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't remember if build-setup action already have check-latest. Please ignore this comment.

cache: yarn
- name: Node.js version
id: node
run: echo "v8CppApiVersion=$(node --print "process.versions.modules")" >> $GITHUB_OUTPUT
- name: Restore dependencies
uses: actions/cache@master
id: cache-deps

- uses: "./.github/actions/setup-and-build"
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}-${{ steps.node.outputs.v8CppApiVersion }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
- name: Install & build
if: steps.cache-deps.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile && yarn build
- name: Build
run: yarn build
if: steps.cache-deps.outputs.cache-hit == 'true'
# </common-build>
node: 20

- name: Generate changelog
run: node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md
Expand Down
26 changes: 3 additions & 23 deletions .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,13 @@ jobs:
needs: tag
if: needs.tag.outputs.is_stable == 'true'
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Needs full depth for changelog generation
- uses: actions/setup-node@v4
with:
node-version: 20
check-latest: true
cache: yarn
- name: Node.js version
id: node
run: echo "v8CppApiVersion=$(node --print "process.versions.modules")" >> $GITHUB_OUTPUT
- name: Restore dependencies
uses: actions/cache@master
id: cache-deps

- uses: "./.github/actions/setup-and-build"
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}-${{ steps.node.outputs.v8CppApiVersion }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
- name: Install & build
if: steps.cache-deps.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile && yarn build
- name: Build
run: yarn build
if: steps.cache-deps.outputs.cache-hit == 'true'
# </common-build>
node: 20

- name: Generate changelog
run: node scripts/generate_changelog.mjs ${{ needs.tag.outputs.prev_tag }} ${{ needs.tag.outputs.tag }} CHANGELOG.md
Expand Down