|
6 | 6 | - "v*" |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - build: |
| 9 | + binary-build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v4 |
| 14 | + |
| 15 | + - uses: oven-sh/setup-bun@v2 |
| 16 | + with: |
| 17 | + bun-version: latest |
| 18 | + |
| 19 | + - uses: actions/setup-go@v5 |
| 20 | + with: |
| 21 | + go-version: "^1.23.2" |
| 22 | + |
| 23 | + - name: Install frontend dependencies |
| 24 | + run: | |
| 25 | + cd frontend |
| 26 | + bun install |
| 27 | +
|
| 28 | + - name: Install backend dependencies |
| 29 | + run: | |
| 30 | + go mod tidy |
| 31 | +
|
| 32 | + - name: Build frontend |
| 33 | + run: | |
| 34 | + cd frontend |
| 35 | + bun run build |
| 36 | +
|
| 37 | + - name: Build |
| 38 | + run: | |
| 39 | + cp -r frontend/dist internal/assets/dist |
| 40 | + CGO_ENABLED=0 go build -ldflags "-s -w" -o tinyauth-amd64 |
| 41 | +
|
| 42 | + - name: Upload artifact |
| 43 | + uses: actions/upload-artifact@v4 |
| 44 | + with: |
| 45 | + name: tinyauth-amd64 |
| 46 | + path: tinyauth-amd64 |
| 47 | + |
| 48 | + binary-build-arm: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + steps: |
| 51 | + - name: Checkout |
| 52 | + uses: actions/checkout@v4 |
| 53 | + |
| 54 | + - uses: oven-sh/setup-bun@v2 |
| 55 | + with: |
| 56 | + bun-version: latest |
| 57 | + |
| 58 | + - uses: actions/setup-go@v5 |
| 59 | + with: |
| 60 | + go-version: "^1.23.2" |
| 61 | + |
| 62 | + - name: Install frontend dependencies |
| 63 | + run: | |
| 64 | + cd frontend |
| 65 | + bun install |
| 66 | +
|
| 67 | + - name: Install backend dependencies |
| 68 | + run: | |
| 69 | + go mod tidy |
| 70 | +
|
| 71 | + - name: Build frontend |
| 72 | + run: | |
| 73 | + cd frontend |
| 74 | + bun run build |
| 75 | +
|
| 76 | + - name: Build |
| 77 | + run: | |
| 78 | + cp -r frontend/dist internal/assets/dist |
| 79 | + CGO_ENABLED=0 go build -ldflags "-s -w" -o tinyauth-arm64 |
| 80 | +
|
| 81 | + - name: Upload artifact |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: tinyauth-arm64 |
| 85 | + path: tinyauth-arm64 |
| 86 | + |
| 87 | + image-build: |
10 | 88 | runs-on: ubuntu-latest |
11 | 89 | steps: |
12 | 90 | - name: Checkout |
|
51 | 129 | if-no-files-found: error |
52 | 130 | retention-days: 1 |
53 | 131 |
|
54 | | - build-arm: |
| 132 | + image-build-arm: |
55 | 133 | runs-on: ubuntu-24.04-arm |
56 | 134 | steps: |
57 | 135 | - name: Checkout |
@@ -96,11 +174,11 @@ jobs: |
96 | 174 | if-no-files-found: error |
97 | 175 | retention-days: 1 |
98 | 176 |
|
99 | | - merge: |
| 177 | + image-merge: |
100 | 178 | runs-on: ubuntu-latest |
101 | 179 | needs: |
102 | | - - build |
103 | | - - build-arm |
| 180 | + - image-build |
| 181 | + - image-build-arm |
104 | 182 | steps: |
105 | 183 | - name: Download digests |
106 | 184 | uses: actions/download-artifact@v4 |
@@ -134,3 +212,18 @@ jobs: |
134 | 212 | run: | |
135 | 213 | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ |
136 | 214 | $(printf 'ghcr.io/${{ github.repository_owner }}/tinyauth@sha256:%s ' *) |
| 215 | +
|
| 216 | + update-release: |
| 217 | + runs-on: ubuntu-latest |
| 218 | + needs: |
| 219 | + - binary-build |
| 220 | + - binary-build-arm |
| 221 | + steps: |
| 222 | + - uses: actions/download-artifact@v4 |
| 223 | + with: |
| 224 | + path: binaries |
| 225 | + |
| 226 | + - name: Release |
| 227 | + uses: softprops/action-gh-release@v2 |
| 228 | + with: |
| 229 | + files: binaries/* |
0 commit comments