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

improve actions workflows #206

Merged
merged 1 commit into from
Aug 29, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/draft-or-update-next-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ on:

jobs:
draft-or-update-next-release:
name: 📝 Draft or update next release
name: 📝 Draft/update next release
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v1
- name: ♻️ Checkout
uses: actions/checkout@v3

- uses: release-drafter/release-drafter@v5
- name: 📝 Draft/update next release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 32 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,75 @@ env:

jobs:
build-and-test:
name: 🎯 Run tests (Node ${{ matrix.node }} / TS ${{ matrix.typescript }})
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18]
typescript: ["~4.5.5", "~4.6.4", "~4.7.4", "~4.8.3", "~4.9.5", "~5.0.4"]
name: Node ${{ matrix.node }} / TS ${{ matrix.typescript }}
node: [16, 18, 20]
typescript:
[
"~4.6.4",
"~4.7.4",
"~4.8.3",
"~4.9.5",
"~5.0.4",
"~5.1.6",
"~5.2.2",
"~5.3.3",
"~5.4.2",
"latest",
]
steps:
- uses: actions/checkout@v3
- name: ♻️ Checkout
uses: actions/checkout@v3

- name: Install node_modules
- name: 🚚 Install node_modules
uses: ./.github/actions/install-node-modules
with:
node-version: ${{ matrix.node }}
typescript-version: ${{ matrix.typescript }}

- name: Run tests
- name: 🎯 Run tests
run: yarn test

release:
name: 🚀 Release
runs-on: ubuntu-latest
name: Release
needs: build-and-test
steps:
- uses: actions/checkout@v3
- name: ♻️ Checkout
uses: actions/checkout@v3
with:
ref: main

- name: Install node_modules
- name: 🚚 Install node_modules
uses: ./.github/actions/install-node-modules
with:
node-version: 18

- name: Clear lib directory
- name: 🗑️ Clear lib directory
run: rm -rf lib

- name: Clear builds directory
- name: 🗑️ Clear builds directory
run: rm -rf builds

- name: Set package version
- name: 📌 Set package version
run: yarn set-package-version ${{ github.event.release.tag_name }}

- name: Build
- name: 🏗️ Build
run: yarn build

- name: Building deno build
- name: 🏗️ Build for Deno
run: yarn rollup -c

- uses: EndBug/add-and-commit@v9.1.3
- name: 💾 Commit Deno Build
uses: EndBug/add-and-commit@v9.1.3
with:
default_author: github_actions
message: "${{ github.event.release.tag_name }} release"

- uses: JS-DevTools/npm-publish@v2
- name: 🚀 Release
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
strategy: upgrade
16 changes: 9 additions & 7 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: 🎯 Test PR

on:
pull_request:
types: [opened, reopened, synchronize]
Expand All @@ -8,13 +9,13 @@ env:

jobs:
build-and-test:
name: 🎯 Run tests (Node ${{ matrix.node }} / TS ${{ matrix.typescript }})
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18]
node: [16, 18, 20]
typescript:
[
"default",
"~4.6.4",
"~4.7.4",
"~4.8.3",
Expand All @@ -24,20 +25,21 @@ jobs:
"~5.2.2",
"~5.3.3",
"~5.4.2",
"latest",
]
name: Node ${{ matrix.node }} / TS ${{ matrix.typescript }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: ♻️ Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0

- name: Install node_modules
- name: 🚚 Install node_modules
uses: ./.github/actions/install-node-modules
with:
node-version: ${{ matrix.node }}
typescript-version: ${{ matrix.typescript }}

- name: Run tests
- name: 🎯 Run tests
run: yarn test
Loading