Skip to content

Commit

Permalink
Github Action for release (#20)
Browse files Browse the repository at this point in the history
Publish generated binaries to release page

Signed-off-by: Aravinda Vishwanathapura <aravinda@kadalu.io>
  • Loading branch information
aravindavk committed Aug 17, 2021
1 parent 4bd76bc commit 38f3f5e
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/on-release-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "On Release"

on:
push:
# Publish `1.2.3` tags as releases.
tags:
- "*"

# Allow to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
release_amd64:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:latest-alpine
steps:
- uses: actions/checkout@v2
- run: shards build --production --release --static --no-debug --stats --time
- name: Rename
run: |
mv bin/gluster-metrics-exporter bin/gluster-metrics-exporter-amd64
- name: Upload gluster-metrics-exporter-amd64 to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/gluster-metrics-exporter-amd64
tag: ${{ github.ref }}
overwrite: true
file_glob: true
release_arm64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Pull images
run: |
docker pull multiarch/qemu-user-static
- name: Install QEMU
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build
working-directory: .
run: |
docker run -i -v `pwd`:/workspace -w /workspace --rm multiarch/alpine:aarch64-latest-stable /bin/sh -c "echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >>/etc/apk/repositories; apk add --update --no-cache --force-overwrite crystal@edge gc-dev gcc gmp-dev libatomic_ops libevent-static musl-dev pcre-dev libxml2-dev openssl-dev openssl-libs-static tzdata yaml-dev zlib-static make git llvm10-dev llvm10-static g++ shards@edge yaml-static; shards build --production --release --static --no-debug --stats --time"
- name: Rename
run: |
sudo mv bin/gluster-metrics-exporter bin/gluster-metrics-exporter-arm64
- name: Upload gluster-metrics-exporter-arm64 to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/gluster-metrics-exporter-arm64
tag: ${{ github.ref }}
overwrite: true
file_glob: true

0 comments on commit 38f3f5e

Please sign in to comment.