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
60 changes: 49 additions & 11 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
DRY_RUN: ${{ github.ref != 'refs/heads/main' }}
Expand All @@ -22,33 +22,67 @@ jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
checks: write

steps:
- name: ⚙️ Setup
uses: containerbase/internal-tools/setup@fee63dbf779bca6bd95975e8a841b3ac027511d0 # v5.4.16
with:
save-cache: true

# shellcheck is used by jactionlint for the `run` scripts
- name: Setup mise
uses: jdx/mise-action@236a21c3b91f5db6d4e174b348674a0f0caac06d # v5.2.9
with:
install_args: jactionlint shellcheck zizmor

- run: pnpm oxfmt

- name: shellcheck
uses: reviewdog/action-shellcheck@950c9d71535c8c49e5c029c33a438ade63b9009c # v1.35.1
with:
fail_level: any
reporter: github-pr-annotations
filter_mode: nofilter
path: |
bin
.husky
pattern: |
*.sh
check_all_files_with_shebangs: 'true'

- name: Check workflow files
run: mise exec -- jactionlint --color

- name: Run zizmor
run: mise exec -- zizmor --format github .github/
env:
GH_TOKEN: ${{ github.token }}

build:
needs:
- lint
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
packages: write

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
show-progress: false

- uses: sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3

- name: Docker registry login
if: env.DRY_RUN == 'false'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ env.OWNER }} --password-stdin
run: echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${OWNER}" --password-stdin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to ghcr.io
uses: containerbase/internal-tools@fee63dbf779bca6bd95975e8a841b3ac027511d0 # v5.4.16
Expand All @@ -62,23 +96,27 @@ jobs:
release:
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
show-progress: false

- name: Init
run: ./bin/init.sh

- uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
- name: Release
if: env.DRY_RUN == 'false'
with:
allowUpdates: true
body: See https://github.com/nodejs/node/releases/tag/v${{ env.VERSION }} for more changes
commit: ${{ github.sha }}
name: ${{ env.VERSION }}
tag: v${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
run: |
notes="See https://github.com/nodejs/node/releases/tag/v${VERSION} for more changes"
if gh release view "v${VERSION}" > /dev/null 2>&1; then
gh release edit "v${VERSION}" --title "${VERSION}" --notes "${notes}"
else
gh release create "v${VERSION}" --target "${GITHUB_SHA}" --title "${VERSION}" --notes "${notes}"
fi
env:
GH_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[tools]
jactionlint = "2.6.0"
shellcheck = "0.11.0"
zizmor = "1.32.0"
Loading