diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92fcf32..2f1214f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -232,56 +232,58 @@ jobs: prerelease: ${{ contains(github.ref, '-') }} # ========================== -# Docker (FROM RELEASE) +# Docker # ========================== docker: - name: Docker (from release) + name: Docker (${{ matrix.platform }}) runs-on: ubuntu-latest - needs: release - + needs: [build-gnu, build-musl] + + strategy: + fail-fast: false + matrix: + include: + - platform: linux/amd64 + artifact: telemt-x86_64-linux-musl + - platform: linux/arm64 + artifact: telemt-aarch64-linux-musl + permissions: contents: read packages: write - + steps: - uses: actions/checkout@v4 - - - name: Install gh - run: apt-get update && apt-get install -y gh - - - name: Extract version - id: vars - run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - - name: Download binary - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/download-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: dist + + - name: Extract binary run: | - mkdir dist - - gh release download ${{ steps.vars.outputs.VERSION }} \ - --repo ${{ github.repository }} \ - --pattern "telemt-x86_64-linux-musl.tar.gz" \ - --dir dist - - tar -xzf dist/telemt-x86_64-linux-musl.tar.gz -C dist + tar -xzf dist/${{ matrix.artifact }}.tar.gz -C dist chmod +x dist/telemt - + - uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3 - + - uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build & Push + + - name: Extract version + id: vars + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Build & Push (per arch) uses: docker/build-push-action@v6 with: context: . push: true - platforms: linux/amd64,linux/arm64 + platforms: ${{ matrix.platform }} tags: | ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.VERSION }} ghcr.io/${{ github.repository }}:latest