Compare commits

..

4 Commits

Author SHA1 Message Date
Jim McDonald
5ce7491d73 Fix workflow 2020-07-21 17:13:40 +01:00
Jim McDonald
b5ecf56382 Tidy ups 2020-07-21 16:42:01 +01:00
Jim McDonald
0acb57df48 Update trigger 2020-07-21 16:20:14 +01:00
Jim McDonald
325baf9f8e Update workflow 2020-07-21 16:17:55 +01:00

View File

@@ -2,9 +2,9 @@ name: Go
on:
push:
branches: [ master ]
# tags:
# - 'v*'
# branches: [ master ]
tags:
- 'v*'
jobs:
build:
@@ -38,14 +38,19 @@ jobs:
- name: Set env
run: |
echo '::set-env name=GO111MODULE::on'
# Release tag comes from the github reference.
RELEASE_TAG=$(echo ${GITHUB_REF} | sed -e 's!.*/!!')
echo "::set-env name=RELEASE_TAG::${RELEASE_TAG}"
# Ensure the release tag is set and a version.
echo "${RELEASE_TAG}" | grep -q '^v' || exit 1
echo "::set-output name=RELEASE_TAG::${RELEASE_TAG}"
# Ensure the release tag has expected format.
echo ${RELEASE_TAG} | grep -q '^v' || exit 1
# Release version is same as release tag without leading 'v'.
RELEASE_VERSION=$(echo ${GITHUB_REF} | sed -e 's!.*/v!!')
echo "::set-env name=RELEASE_VERSION::${RELEASE_VERSION}"
echo "::set-output name=RELEASE_VERSION::${RELEASE_VERSION}"
- name: Fetch xgo
run: |
env
go get github.com/suburbandad/xgo
- name: Cross-compile
@@ -54,17 +59,17 @@ jobs:
- name: Create windows zip file
run: |
mv ethdo-windows-4.0-amd64.exe ethdo.exe
zip --junk-paths ethdo-${RELEASE_TAG}-windows-exe.zip ethdo.exe
zip --junk-paths ethdo-${RELEASE_VERSION}-windows-exe.zip ethdo.exe
- name: Create linux AMD64 tgz file
run: |
mv ethdo-linux-amd64 ethdo
tar zcf ethdo-${RELEASE_TAG}-linux-amd64.tar.gz ethdo
tar zcf ethdo-${RELEASE_VERSION}-linux-amd64.tar.gz ethdo
- name: Create linux ARM64 tgz file
run: |
mv ethdo-linux-arm64 ethdo
tar zcf ethdo-${RELEASE_TAG}-linux-arm64.tar.gz ethdo
tar zcf ethdo-${RELEASE_VERSION}-linux-arm64.tar.gz ethdo
- name: Create release
id: create_release
@@ -73,7 +78,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
release_name: Release ${{ env.RELEASE_VERSION }}
draft: true
prerelease: true
@@ -84,8 +89,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ethdo-${{ github.ref }}-windows-exe.zip
asset_name: ethdo-${{ github.ref }}-windows-exe.zip
asset_path: ./ethdo-${{ env.RELEASE_VERSION }}-windows-exe.zip
asset_name: ethdo-${{ env.RELEASE_VERSION }}-windows-exe.zip
asset_content_type: application/zip
- name: Upload linux AMD64 tgz file
@@ -95,8 +100,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ethdo-${{ github.ref }}-linux-amd64.tar.gz
asset_name: ethdo-${{ github.ref }}-linux-amd64.tar.gz
asset_path: ./ethdo-${{ env.RELEASE_VERSION }}-linux-amd64.tar.gz
asset_name: ethdo-${{ env.RELEASE_VERSION }}-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload linux ARM64 tgz file
@@ -106,6 +111,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ethdo-${{ github.ref }}-linux-arm64.tar.gz
asset_name: ethdo-${{ github.ref }}-linux-arm64.tar.gz
asset_path: ./ethdo-${{ env.RELEASE_VERSION }}-linux-arm64.tar.gz
asset_name: ethdo-${{ env.RELEASE_VERSION }}-linux-arm64.tar.gz
asset_content_type: application/gzip