Skip to content

Merge branch 'changelog-0.1.0' into 'main' #7

Merge branch 'changelog-0.1.0' into 'main'

Merge branch 'changelog-0.1.0' into 'main' #7

Workflow file for this run

name: Build Binaries
on:
push:
tags:
- '**'
pull_request:
jobs:
build:
runs-on: self-hosted
container: golang:1.18
strategy:
matrix:
GOOS: [ "linux", "darwin", "windows" ]
GOARCH: [ "amd64", "arm64" ]
steps:
- uses: actions/checkout@v2
- name: Build Binary
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
run: make build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: chia-price-exporter-${{ matrix.GOOS }}-${{ matrix.GOARCH }}
path: ${{ github.workspace }}/bin/chia-price-exporter*
release:
runs-on: self-hosted
needs:
- build
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: Show artifacts
run: tree artifacts
- name: Generate artifact zips
run: |
cd ${{ github.workspace }}/artifacts || exit 1
DIRS=$(find . -type d -name 'chia-price-exporter*')
while IFS= read -r dir; do
echo "Creating zip for $dir..."
zip -r $dir.zip $dir
done <<< "$DIRS"
- name: Get zip filenames
id: release-files
run: |
FILES=$(find ${{ github.workspace }}/artifacts -type f -name 'chia-price-exporter*.zip')
# Replace chars in the manner GHA expects to this ends up multiline in the next step
FILES="${FILES//'%'/'%25'}"
FILES="${FILES//$'\n'/'%0A'}"
FILES="${FILES//$'\r'/'%0D'}"
echo "::set-output name=FILES::$FILES"
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.release-files.outputs.FILES }}