Merge pull request #33 from core-coin/update/notranslate-01 #184
Workflow file for this run
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
name: wallet-generator 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/wallet-generator main.go templates.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} | |
run: go build -o bin/wallet-generator.exe -buildmode=exe main.go templates.go | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wallet-generator-${{ matrix.platform.path }} | |
path: ./bin/wallet-generator* | |
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.GH_ACCESS_TOKEN }} | |
with: | |
tag_name: ${{ steps.version.outputs.tag }} | |
release_name: ${{ steps.version.outputs.tag }} wallet-generator release | |
draft: false | |
prerelease: true | |
artifacts: | |
needs: release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [linux-x86_64, darwin-x86_64, windows-x86_64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: wallet-generator-${{ matrix.platform }} | |
path: ./wallet-generator-${{ matrix.platform }} | |
- name: Upload release assets (Linux and MacOS) | |
if: matrix.platform != 'windows-x86_64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./wallet-generator-${{ matrix.platform }}/wallet-generator | |
asset_name: wallet-generator-${{ matrix.platform }} | |
asset_content_type: application/octet-stream | |
- name: Upload release assets (Windows) | |
if: matrix.platform == 'windows-x86_64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./wallet-generator-${{ matrix.platform }}/wallet-generator.exe | |
asset_name: wallet-generator-${{ matrix.platform }}.exe | |
asset_content_type: application/octet-stream | |
- name: Generate checksums (Linux and Mac) | |
if: matrix.platform != 'windows-x86_64' | |
working-directory: ./wallet-generator-${{ matrix.platform }} | |
run: | | |
mv ./wallet-generator ./wallet-generator-${{ matrix.platform }} | |
sha256sum wallet-generator-${{ matrix.platform }} >wallet-generator-${{ matrix.platform }}.checksum | |
- name: Generate checksums (Windows) | |
if: matrix.platform == 'windows-x86_64' | |
working-directory: ./wallet-generator-${{ matrix.platform }} | |
run: | | |
mv ./wallet-generator.exe ./wallet-generator-${{ matrix.platform }}.exe | |
sha256sum wallet-generator-${{ matrix.platform }}.exe >wallet-generator-${{ matrix.platform }}.exe.checksum | |
- name: Upload release assets checksums (Linux and Mac) | |
if: matrix.platform != 'windows-x86_64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./wallet-generator-${{ matrix.platform }}/wallet-generator-${{ matrix.platform }}.checksum | |
asset_name: wallet-generator-${{ matrix.platform }}.checksum | |
asset_content_type: text/plain | |
- name: Upload wallet-generator release assets checksums (Windows) | |
if: matrix.platform == 'windows-x86_64' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: ./wallet-generator-${{ matrix.platform }}/wallet-generator-${{ matrix.platform }}.exe.checksum | |
asset_name: wallet-generator-${{ matrix.platform }}.exe.checksum | |
asset_content_type: text/plain |