Compare commits

...

6 Commits

Author SHA1 Message Date
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
Jim McDonald
1c2385e413 Catch potential error 2020-07-21 16:09:56 +01:00
Jim McDonald
c06a709463 Update workflow 2020-07-21 15:57:37 +01:00
Jim McDonald
735cc3ae4b Update workflow 2020-07-21 15:31:12 +01:00

View File

@@ -23,11 +23,11 @@ jobs:
- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: go build -v .
@@ -38,30 +38,32 @@ jobs:
- name: Set env
run: |
echo '::set-env name=GO111MODULE::on'
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
- name: Fetch xgo
run: go get github.com/suburbandad/xgo
run: |
go get github.com/suburbandad/xgo
- name: Cross-compile
run: xgo -v -x --targets="linux/amd64,linux/arm64,windows/amd64" github.com/wealdtech/ethdo
- name: Create windows zip file
run: |
env
echo ${GITHUB_REF}
echo $(git describe --abbrev=0)
mv ethdo-windows-4.0-amd64.exe ethdo.exe
zip --junk-paths ethdo-$(git describe --abbrev=0)-windows-exe.zip ethdo.exe
zip --junk-paths ethdo-${RELEASE_TAG}-windows-exe.zip ethdo.exe
- name: Create linux AMD64 tgz file
run: |
mv ethdo-linux-amd64 ethdo
tar zcf ethdo-$(git describe --abbrev=0)-linux-amd64.tar.gz ethdo
tar zcf ethdo-${RELEASE_TAG}-linux-amd64.tar.gz ethdo
- name: Create linux ARM64 tgz file
run: |
mv ethdo-linux-arm64 ethdo
tar zcf ethdo-$(git describe --abbrev=0)-linux-arm64.tar.gz ethdo
tar zcf ethdo-${RELEASE_TAG}-linux-arm64.tar.gz ethdo
- name: Create release
id: create_release
@@ -71,7 +73,7 @@ jobs:
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
draft: true
prerelease: true
- name: Upload windows zip file
@@ -81,8 +83,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-${RELEASE_TAG}-windows-exe.zip
asset_name: ethdo-${RELEASE_TAG}-windows-exe.zip
asset_content_type: application/zip
- name: Upload linux AMD64 tgz file
@@ -92,8 +94,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-${RELEASE_TAG}-linux-amd64.tar.gz
asset_name: ethdo-${RELEASE_TAG}-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload linux ARM64 tgz file
@@ -103,6 +105,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-${RELEASE_TAG}-linux-arm64.tar.gz
asset_name: ethdo-${RELEASE_TAG}-linux-arm64.tar.gz
asset_content_type: application/gzip