Skip to content

Commit

Permalink
chore: add build steps for ARM architecture (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-voigt authored Jun 27, 2024
1 parent 0f5680e commit 04c255f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN apk add --no-cache \
ttf-freefont \
inotify-tools \
tini
COPY build-artifacts/vistecture-linux /usr/local/bin/vistecture
COPY build-artifacts/vistecture-linux-$TARGETARCH /usr/local/bin/vistecture
51 changes: 26 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: '^1.17.x'
- run: GOOS=linux GOARCH=amd64 go build -o build-artifacts/vistecture-linux vistecture.go
- run: GOOS=linux GOARCH=amd64 go build -o build-artifacts/vistecture-linux-amd64 vistecture.go
- run: GOOS=linux GOARCH=arm64 go build -o build-artifacts/vistecture-linux-arm64 vistecture.go
- run: GOOS=windows go build -o build-artifacts/vistecture.exe vistecture.go
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: binaries
path: build-artifacts/vistecture*
Expand All @@ -81,7 +82,7 @@ jobs:
draft: false
prerelease: false
- name: Download go-binary artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: binaries
path: ./
Expand All @@ -96,47 +97,47 @@ jobs:
asset_name: vistecture.exe
asset_content_type: application/octet-stream
- name: Upload vistecture linux asset
id: upload-linux-asset
id: upload-linux-asset-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./vistecture-linux
asset_path: ./vistecture-linux-amd64
asset_name: vistecture-amd64
asset_content_type: application/octet-stream
- name: Upload vistecture linux asset
id: upload-linux-asset-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./vistecture-linux-arm64
asset_name: vistecture-arm64
asset_content_type: application/octet-stream
docker:
if: startsWith(github.ref, 'refs/tags/ggadfgv')
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [ go-binaries ]
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Download go-binary artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: binaries
path: build-artifacts
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Login to DockerHub
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build
uses: docker/build-push-action@v2
- name: Build
uses: docker/build-push-action@v6
with:
push: true
tags: |
aoepeople/vistecture:${{ github.ref }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
tags: aoepeople/vistecture:${{ github.ref }}
platforms: linux/amd64,linux/arm64

0 comments on commit 04c255f

Please sign in to comment.