-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish generated binaries to release page Signed-off-by: Aravinda Vishwanathapura <aravinda@kadalu.io>
- Loading branch information
1 parent
4bd76bc
commit 38f3f5e
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |