Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add build steps for ARM architecture #42

Merged
merged 8 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading