chore: update cargo-dist workflow
f272d68d
8 file(s) · +52 −9
| 16 | 16 | runs-on: ubuntu-latest |
|
| 17 | 17 | outputs: |
|
| 18 | 18 | apps: ${{ steps.filter.outputs.apps }} |
|
| 19 | + | version: ${{ steps.filter.outputs.version }} |
|
| 19 | 20 | steps: |
|
| 20 | 21 | - uses: actions/checkout@v4 |
|
| 21 | 22 | with: |
|
| 26 | 27 | run: | |
|
| 27 | 28 | ALL='["sipp","feeds","parcels","jotts","og","shrink"]' |
|
| 28 | 29 | ||
| 29 | - | # Tags always build everything |
|
| 30 | + | # Map cargo package names to directory names |
|
| 31 | + | pkg_to_dir() { |
|
| 32 | + | case "$1" in |
|
| 33 | + | sipp-so) echo "sipp" ;; |
|
| 34 | + | *) echo "$1" ;; |
|
| 35 | + | esac |
|
| 36 | + | } |
|
| 37 | + | ||
| 38 | + | # Tags: per-app (app/version) or bare (version) |
|
| 30 | 39 | if [[ "${GITHUB_REF}" == refs/tags/* ]]; then |
|
| 31 | - | echo "apps=${ALL}" >> "$GITHUB_OUTPUT" |
|
| 40 | + | TAG="${GITHUB_REF#refs/tags/}" |
|
| 41 | + | ||
| 42 | + | if [[ "$TAG" == */* ]]; then |
|
| 43 | + | PKG="${TAG%/*}" |
|
| 44 | + | VERSION="${TAG##*/}" |
|
| 45 | + | APP=$(pkg_to_dir "$PKG") |
|
| 46 | + | echo "apps=[\"${APP}\"]" >> "$GITHUB_OUTPUT" |
|
| 47 | + | echo "version=${VERSION}" >> "$GITHUB_OUTPUT" |
|
| 48 | + | else |
|
| 49 | + | echo "apps=${ALL}" >> "$GITHUB_OUTPUT" |
|
| 50 | + | echo "version=${TAG}" >> "$GITHUB_OUTPUT" |
|
| 51 | + | fi |
|
| 32 | 52 | exit 0 |
|
| 33 | 53 | fi |
|
| 34 | 54 | ||
| 68 | 88 | steps: |
|
| 69 | 89 | - uses: actions/checkout@v4 |
|
| 70 | 90 | ||
| 71 | - | - name: Set up QEMU |
|
| 72 | - | uses: docker/setup-qemu-action@v3 |
|
| 73 | - | ||
| 74 | 91 | - name: Set up Docker Buildx |
|
| 75 | 92 | uses: docker/setup-buildx-action@v3 |
|
| 76 | 93 | ||
| 87 | 104 | with: |
|
| 88 | 105 | images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.app }} |
|
| 89 | 106 | tags: | |
|
| 90 | - | type=ref,event=tag |
|
| 107 | + | type=raw,value=${{ needs.changes.outputs.version }},enable=${{ needs.changes.outputs.version != '' }} |
|
| 91 | 108 | type=raw,value=latest,enable={{is_default_branch}} |
|
| 92 | 109 | ||
| 93 | 110 | - name: Build and push |
|
| 95 | 112 | with: |
|
| 96 | 113 | context: . |
|
| 97 | 114 | file: apps/${{ matrix.app }}/Dockerfile |
|
| 98 | - | platforms: linux/amd64,linux/arm64 |
|
| 99 | 115 | push: true |
|
| 100 | 116 | tags: ${{ steps.meta.outputs.tags }} |
|
| 101 | 117 | labels: ${{ steps.meta.outputs.labels }} |
|
| 2 | 2 | name = "feeds" |
|
| 3 | 3 | version = "0.1.0" |
|
| 4 | 4 | edition = "2024" |
|
| 5 | + | description = "Minimal RSS feed reader" |
|
| 6 | + | license = "MIT" |
|
| 7 | + | repository = "https://github.com/stevedylandev/andromeda" |
|
| 8 | + | homepage = "https://github.com/stevedylandev/andromeda" |
|
| 5 | 9 | ||
| 6 | 10 | [dependencies] |
|
| 7 | 11 | axum = { workspace = true } |
| 2 | 2 | name = "jotts" |
|
| 3 | 3 | version = "0.1.0" |
|
| 4 | 4 | edition = "2024" |
|
| 5 | + | description = "Minimal markdown note app" |
|
| 6 | + | license = "MIT" |
|
| 7 | + | repository = "https://github.com/stevedylandev/andromeda" |
|
| 8 | + | homepage = "https://github.com/stevedylandev/andromeda" |
|
| 5 | 9 | ||
| 6 | 10 | [dependencies] |
|
| 7 | 11 | axum = { workspace = true } |
| 2 | 2 | name = "og" |
|
| 3 | 3 | version = "0.1.0" |
|
| 4 | 4 | edition = "2024" |
|
| 5 | + | description = "Minimal opengraph previewer" |
|
| 6 | + | license = "MIT" |
|
| 7 | + | repository = "https://github.com/stevedylandev/andromeda" |
|
| 8 | + | homepage = "https://github.com/stevedylandev/andromeda" |
|
| 5 | 9 | ||
| 6 | 10 | [dependencies] |
|
| 7 | 11 | axum = { workspace = true } |
| 2 | 2 | name = "parcels" |
|
| 3 | 3 | version = "0.1.0" |
|
| 4 | 4 | edition = "2024" |
|
| 5 | + | description = "Minimal package tracking" |
|
| 6 | + | license = "MIT" |
|
| 7 | + | repository = "https://github.com/stevedylandev/andromeda" |
|
| 8 | + | homepage = "https://github.com/stevedylandev/andromeda" |
|
| 5 | 9 | ||
| 6 | 10 | [[bin]] |
|
| 7 | 11 | name = "parcels" |
| 2 | 2 | name = "shrink" |
|
| 3 | 3 | version = "0.1.0" |
|
| 4 | 4 | edition = "2024" |
|
| 5 | + | description = "Minimal image compression and resizing service" |
|
| 6 | + | license = "MIT" |
|
| 7 | + | repository = "https://github.com/stevedylandev/andromeda" |
|
| 8 | + | homepage = "https://github.com/stevedylandev/andromeda" |
|
| 5 | 9 | ||
| 6 | 10 | [dependencies] |
|
| 7 | 11 | axum = { workspace = true, features = ["multipart"] } |
| 4 | 4 | edition = "2024" |
|
| 5 | 5 | description = "Minimal code sharing - single binary for web server, CLI, and TUI" |
|
| 6 | 6 | license = "MIT" |
|
| 7 | - | repository = "https://github.com/stevedylandev/sipp" |
|
| 7 | + | repository = "https://github.com/stevedylandev/andromeda" |
|
| 8 | 8 | homepage = "https://sipp.so" |
|
| 9 | 9 | documentation = "https://github.com/stevedylandev/sipp#readme" |
|
| 10 | 10 | readme = "README.md" |
| 1 | 1 | [workspace] |
|
| 2 | - | members = ["cargo:apps/sipp"] |
|
| 2 | + | members = [ |
|
| 3 | + | "cargo:apps/sipp", |
|
| 4 | + | "cargo:apps/feeds", |
|
| 5 | + | "cargo:apps/parcels", |
|
| 6 | + | "cargo:apps/jotts", |
|
| 7 | + | "cargo:apps/og", |
|
| 8 | + | "cargo:apps/shrink", |
|
| 9 | + | ] |
|
| 3 | 10 | ||
| 4 | 11 | # Config for 'dist' |
|
| 5 | 12 | [dist] |