Skip to content

Commit

Permalink
Support arm64 build
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Jun 29, 2024
1 parent 0c1237f commit 3016be1
Showing 1 changed file with 39 additions and 14 deletions.
53 changes: 39 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Release

on:
push:
branches: [main]
release:
types:
- published
workflow_dispatch:

jobs:
publish-release:
Expand All @@ -16,23 +19,45 @@ jobs:
- name: Fetch git tags
run: git fetch --prune --unshallow --tags

- name: Get release version
run: |
VERSION=`echo "${{ github.ref_name }}" | sed 's/v\(.*\)/\1/' `
echo "VERSION=${VERSION}"
echo "VERSION=${VERSION}" >> ${GITHUB_ENV}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Docker Build
run: |
docker build -t yurishkuro/microsim:${VERSION} .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Docker Login
run: |
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u "yurishkuro" docker.io --password-stdin
- name: Extract tags/labels from Git
id: docker_meta
uses: docker/metadata-action@v5
with:
images: jaegertracing/protobuf
# The 'tags:' section defines how the Docker image will be tagged:
# - pushes to main branch will be published as 'latest'
# - pushes tagged with semver will be published as that version (without 'v')
# - other tags can be used as is
# Documentation: https://github.com/docker/metadata-action#tags-input
tags: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{version}}
type=ref,event=tag
- name: Docker Upload
run: |
docker push yurishkuro/microsim:${VERSION}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: yurishkuro
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and maybe push Docker image
uses: docker/build-push-action@v5
with:
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64

- name: SBOM Generation
uses: anchore/sbom-action@v0.16.0
Expand Down

0 comments on commit 3016be1

Please sign in to comment.