Skip to content

Commit ffa6399

Browse files
committed
fix
1 parent 421481f commit ffa6399

File tree

1 file changed

+22
-46
lines changed

1 file changed

+22
-46
lines changed

.github/workflows/build-linux-release.yml

+22-46
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ jobs:
8585
needs: [ build-linux ]
8686
runs-on: ubuntu-latest
8787
name: 📦 Build Alpine Docker Container
88+
strategy:
89+
fail-fast: false
90+
matrix:
91+
platform:
92+
- os: linux
93+
arch: amd64
94+
- os: linux
95+
arch: arm64
8896
steps:
8997
- name: Checkout code
9098
uses: actions/checkout@v3
@@ -109,47 +117,24 @@ jobs:
109117
fi
110118
echo "VERSION=$VERSION" >> $GITHUB_ENV
111119
112-
- name: Download Linux AMD64 binary
113-
uses: actions/download-artifact@v4
120+
- name: Download Linux ${{ matrix.platform.arch }} binary
121+
uses: actions/download-artifact@v3
114122
with:
115-
name: ctx-${{ env.VERSION }}-linux-amd64
116-
path: ./tmp/amd64
117-
118-
- name: Download Linux ARM64 binary
119-
uses: actions/download-artifact@v4
120-
with:
121-
name: ctx-${{ env.VERSION }}-linux-arm64
122-
path: ./tmp/arm64
123+
name: ctx-${{ env.VERSION }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
124+
path: ./tmp
123125

124-
- name: Make binaries executable
126+
- name: Make binary executable
125127
run: |
126-
chmod +x ./tmp/amd64/ctx-${{ env.VERSION }}-linux-amd64
127-
chmod +x ./tmp/arm64/ctx-${{ env.VERSION }}-linux-arm64
128+
chmod +x ./tmp/ctx-${{ env.VERSION }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
128129
129130
- name: Create Docker context directory
130131
run: |
131-
mkdir -p ./docker/amd64 ./docker/arm64
132-
cp ./tmp/amd64/ctx-${{ env.VERSION }}-linux-amd64 ./docker/amd64/ctx
133-
cp ./tmp/arm64/ctx-${{ env.VERSION }}-linux-arm64 ./docker/arm64/ctx
132+
mkdir -p ./docker
133+
cp ./tmp/ctx-${{ env.VERSION }}-${{ matrix.platform.os }}-${{ matrix.platform.arch }} ./docker/ctx
134134
135-
# Create Dockerfile for AMD64
136-
cat > ./docker/amd64/Dockerfile << 'EOF'
137-
FROM alpine:3.19
138-
139-
RUN apk add --no-cache libstdc++ libgcc
140-
141-
WORKDIR /app
142-
143-
COPY ctx /usr/local/bin/ctx
144-
145-
RUN chmod +x /usr/local/bin/ctx
146-
147-
ENTRYPOINT ["ctx"]
148-
EOF
149-
150-
# Create Dockerfile for ARM64
151-
cat > ./docker/arm64/Dockerfile << 'EOF'
152-
FROM alpine:3.19
135+
# Create Dockerfile for Alpine
136+
cat > ./docker/Dockerfile << 'EOF'
137+
FROM alpine:3.21
153138
154139
RUN apk add --no-cache libstdc++ libgcc
155140
@@ -180,20 +165,11 @@ jobs:
180165
username: ${{ secrets.GHCR_LOGIN }}
181166
password: ${{ secrets.GHCR_PASSWORD }}
182167

183-
- name: Build and push Docker image for ARM64
184-
uses: docker/build-push-action@v4
185-
with:
186-
context: ./docker/arm64
187-
push: true
188-
tags: ${{ steps.docker-metadata.outputs.tags }}
189-
labels: ${{ steps.docker-metadata.outputs.labels }}
190-
platforms: linux/arm64
191-
192-
- name: Build and push Docker image for AMD64
168+
- name: Build and push Docker image
193169
uses: docker/build-push-action@v4
194170
with:
195-
context: ./docker/amd64
171+
context: ./docker
196172
push: true
197173
tags: ${{ steps.docker-metadata.outputs.tags }}
198174
labels: ${{ steps.docker-metadata.outputs.labels }}
199-
platforms: linux/amd64
175+
platforms: linux/${{ matrix.platform.arch }}

0 commit comments

Comments
 (0)