ci: cherry-pick changes from PR #815

That PR got hard to review and confidently merge, so I'm cherry-picking
some of the good ideas from it in a format that feels more comfortable
to me. Thanks @vlakoff for the original PR!

Co-authored-by: vlakoff <544424+vlakoff@users.noreply.github.com>
This commit is contained in:
Alejandro González 2026-05-08 23:25:01 +02:00
parent 028294cc8c
commit 4e80dd009a
No known key found for this signature in database
5 changed files with 34 additions and 15 deletions

View file

@ -1,4 +1,7 @@
scripts
.github
.editorconfig
.pre-commit-hooks.yaml
.gitignore
/.git/
/.github/
/.pre-commit-hooks.yaml
/scripts/
/target/

View file

@ -3,7 +3,12 @@ name: deploy
on:
push:
tags:
- "v*.*.*"
- v*.*.*
concurrency:
# If we ever end up with two concurrent jobs for releasing the same tag, the former should be cancelled
group: release-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
@ -54,15 +59,15 @@ jobs:
- name: Get the Oxipng version
id: oxipngMeta
run:
echo "version=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[] | select(.name == "oxipng").version')"
>> "$GITHUB_OUTPUT"
run: >
echo "version=$(cargo metadata --format-version 1 --no-deps |
jq -r '.packages[] | select(.name == "oxipng").version')" >> "$GITHUB_OUTPUT"
- name: Retrieve ${{ matrix.target }} binary
uses: dawidd6/action-download-artifact@v21
with:
workflow: oxipng.yml
commit: ${{ env.GITHUB_SHA }}
commit: ${{ github.sha }}
name: Oxipng binary (${{ matrix.target }})
path: target

View file

@ -2,9 +2,9 @@ name: docker
on:
push:
branches:
- 'master'
- master
tags:
- 'v*.*.*'
- v*.*.*
pull_request:
types:
- opened
@ -17,6 +17,12 @@ on:
type: boolean
default: true
concurrency:
# If we ever end up with two concurrent Docker build jobs for the same commit
# and same versioning context, the former should be cancelled
group: docker-${{ github.sha }}-${{ github.ref_type }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build:
uses: docker/github-builder/.github/workflows/build.yml@v1

View file

@ -8,6 +8,11 @@ on:
- synchronize
workflow_dispatch:
concurrency:
# If we ever end up with two concurrent CI jobs for the same commit, the former should be cancelled
group: ci-${{ github.sha }}
cancel-in-progress: true
jobs:
ci:
name: CI
@ -126,7 +131,7 @@ jobs:
- name: Build CLI binary
run: cargo build --release -Zbuild-std
env:
RUSTFLAGS: '-Zlocation-detail=none -Zunstable-options -Cpanic=immediate-abort'
RUSTFLAGS: "-Zlocation-detail=none -Zunstable-options -Cpanic=immediate-abort"
- name: Upload CLI binary as artifact
uses: actions/upload-artifact@v7

8
.gitignore vendored
View file

@ -1,6 +1,6 @@
target
*.bk
.DS_Store
*.bk
*.out.png
/.idea
/node_modules
/.idea/
/node_modules/
/target/