Skip to content
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
32 changes: 17 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ on:
pull_request:
branches: [main]

permissions:
contents: write

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
Expand All @@ -24,7 +23,7 @@ jobs:
run: npm install -g yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: echo "dir=$(yarn cache dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v5
id: yarn-cache
with:
Expand All @@ -34,14 +33,17 @@ jobs:
${{ runner.os }}-yarn-
- name: Install Deps
run: yarn install --pure-lockfile
# - name: Build & Test
# run: yarn test
- name: Ensure dist/ folder is up-to-date
- name: Build
run: yarn build
- name: Commit dist/ changes
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
yarn build
if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
git add dist/
if git diff --cached --quiet; then
echo "dist/ is up to date, nothing to commit"
else
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m "chore: update dist/ build artifacts"
git push
fi

5 changes: 4 additions & 1 deletion .github/workflows/lookup-only.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: test-lookup-only

on:
push:
workflow_run:
workflows: [build]
types: [completed]
branches: [main]
pull_request:
branches: [main]

jobs:
test-save:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release

on:
release:
types: [published]

permissions:
contents: write

jobs:
update-major-tag:
runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'v')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update major version tag
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
# Extract major version (e.g., v1.9.0 -> v1)
MAJOR_TAG="${RELEASE_TAG%%.*}"
echo "Moving ${MAJOR_TAG} tag to ${RELEASE_TAG}"
git tag -fa "${MAJOR_TAG}" -m "${MAJOR_TAG} compatible release"
git push -f origin "${MAJOR_TAG}"
5 changes: 4 additions & 1 deletion .github/workflows/test-env.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: test-env

on:
push:
workflow_run:
workflows: [build]
types: [completed]
branches: [main]
pull_request:
branches: [main]

jobs:
test-save:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-exact-match.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: test-exact-match

on:
push:
workflow_run:
workflows: [build]
types: [completed]
branches: [main]
pull_request:
branches: [main]
Expand All @@ -11,6 +13,7 @@ jobs:
# e.g. key = "test-exact-Linux-12345-decoy" which shares the prefix
# "test-exact-Linux-12345" with the key we'll try to restore later.
test-save-decoy:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
strategy:
matrix:
os: [ubuntu-latest]
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: test

on:
push:
workflow_run:
workflows: [build]
types: [completed]
branches: [main]
pull_request:
branches: [main]

jobs:
test-save:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
Expand Down Expand Up @@ -95,6 +98,7 @@ jobs:
run: src/verify-cache-files.sh ${{ runner.os }} ~/test-cache

test-save-retry:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
Expand Down Expand Up @@ -156,6 +160,7 @@ jobs:
run: src/verify-cache-files.sh ${{ runner.os }} ~/test-cache

test-save-only:
if: github.event_name == 'pull_request' || github.event.workflow_run.conclusion == 'success'
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
Expand Down
Loading