Skip to content

Merge pull request #4 from core-coin/fix/gocore_bump #30

Merge pull request #4 from core-coin/fix/gocore_bump

Merge pull request #4 from core-coin/fix/gocore_bump #30

Workflow file for this run

name: pigeon build
on: push
jobs:
build:
strategy:
matrix:
platform: [
{os: ubuntu-latest, path: linux-x86_64},
{os: macos-latest, path: darwin-x86_64},
{os: windows-latest, path: windows-x86_64},
]
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-go@v2
with:
go-version: 1.19.x
- name: Build for Mac and Linux
if: matrix.platform.path == 'linux-x86_64' || matrix.platform.path == 'darwin-x86_64'
run: |
go build -o bin/pigeon main.go
- name: Setup MSYS
if: ${{ matrix.platform.path == 'windows-x86_64' }}
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: >
git
base-devel
autoconf-wrapper
autoconf
automake
libtool
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-go
- name: Build for Windows
if: ${{ matrix.platform.path == 'windows-x86_64' }}
shell: msys2 {0}
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go build -o bin/pigeon.exe -buildmode=exe main.go
- name: Upload
uses: actions/upload-artifact@v2
with:
name: pigeon-${{ matrix.platform.path }}
path: ./bin/pigeon*
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Version
id: version
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})
- name: Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.tag }}
release_name: ${{ steps.version.outputs.tag }} pigeon release
draft: false
prerelease: true
artifacts:
needs: release
runs-on: ubuntu-latest
strategy:
matrix:
platform: [
{ path: linux-x86_64, file_ext: "" },
{ path: windows-x86_64, file_ext: ".exe" },
{ path: darwin-x86_64, file_ext: "" },
]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Artifact pigeon
uses: actions/download-artifact@v2
with:
name: pigeon-${{ matrix.platform.path}}
path: ./pigeon-${{ matrix.platform.path }}
- name: Upload pigeon release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./pigeon-${{ matrix.platform.path }}/pigeon${{matrix.platform.file_ext}}
asset_name: pigeon-${{ matrix.platform.path }}${{matrix.platform.file_ext}}
asset_content_type: application/octet-stream
- name: Generate pigeon checksums
working-directory: ./pigeon-${{ matrix.platform.path }}
run: |
mv ./pigeon${{matrix.platform.file_ext}} ./pigeon-${{ matrix.platform.path }}${{matrix.platform.file_ext}}
sha256sum pigeon-${{ matrix.platform.path }}${{matrix.platform.file_ext}} >pigeon-${{ matrix.platform.path }}${{matrix.platform.file_ext}}.checksum
- name: Upload pigeon release assets checksums (Linux and Mac)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./pigeon-${{ matrix.platform.path }}/pigeon-${{ matrix.platform.path }}${{matrix.platform.file_ext}}.checksum
asset_name: pigeon-${{ matrix.platform.path }}${{matrix.platform.file_ext}}.checksum
asset_content_type: text/plain