-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
140 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: 'My composite action' | ||
description: 'Checks out the repository and install' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Restore cached npm dependencies | ||
id: cache-dependencies-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache/Cypress # needed for the Cypress binary | ||
key: ${{ runner.os }}npm-dependencies-${{ hashFiles('package-lock.json') }} | ||
- name: Npm install | ||
run: npm ci | ||
shell: bash | ||
- name: Cache npm dependencies | ||
id: cache-dependencies-save | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache/Cypress # needed for the Cypress binary | ||
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} | ||
- name: Derive appropriate SHAs for base and head for `nx affected` commands | ||
uses: nrwl/nx-set-shas@v4 | ||
with: | ||
main-branch-name: "master" |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Create Releases | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test: | ||
name: "Build and test" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: "read" | ||
actions: "read" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Npm install | ||
uses: ./.github/actions | ||
- run: npx nx affected -t lint test build --parallel=3 --exclude='test-npm' --base=origin/main~1 --head=origin/main | ||
# - run: npm nx affected -t e2e-ci --parallel=1 | ||
# - run: npm nx affected -t deploy --no-agents | ||
|
||
bump-version: | ||
name: "Bump version" | ||
needs: | ||
- build-and-test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: "write" | ||
actions: "read" | ||
id-token: "write" | ||
timeout-minutes: 10 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- name: Checkout and install | ||
uses: ./.github/actions | ||
- name: Bump version | ||
run: | | ||
git config user.name 'Alex H' | ||
git config user.email '[email protected]' | ||
npx nx release --skip-publish | ||
shell: bash | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_CONFIG_PROVENANCE: true |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- synchronize | ||
jobs: | ||
run-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Npm install | ||
uses: ./.github/actions | ||
# This line is needed for nx affected to work when CI is running on a PR | ||
- run: git branch --track main origin/main | ||
- run: npx nx affected -t lint test build --parallel=3 --exclude='test-npm' | ||
# - run: npm nx affected -t e2e-ci --parallel=1 | ||
# - run: npm nx affected -t deploy --no-agents |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Publish | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ "Create Releases" ] | ||
types: | ||
- completed | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
NPM_CONFIG_PROVENANCE: true | ||
|
||
jobs: | ||
publish: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: "read" | ||
actions: "read" | ||
id-token: "write" # needed for provenance data generation | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Npm install | ||
uses: ./.github/actions | ||
- run: npx nx affected -t build --parallel=3 --exclude='test-npm' --base=origin/main~1 --head=origin/main | ||
- name: Publish packages | ||
run: npx nx release publish | ||
shell: bash |