Fix workflow

This commit is contained in:
Jim McDonald
2020-07-21 17:13:40 +01:00
parent b5ecf56382
commit 5ce7491d73

View File

@@ -38,10 +38,16 @@ 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 "::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: |
@@ -53,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
@@ -72,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
@@ -83,8 +89,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ethdo-${RELEASE_TAG}-windows-exe.zip
asset_name: ethdo-${RELEASE_TAG}-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
@@ -94,8 +100,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ethdo-${RELEASE_TAG}-linux-amd64.tar.gz
asset_name: ethdo-${RELEASE_TAG}-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
@@ -105,6 +111,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./ethdo-${RELEASE_TAG}-linux-arm64.tar.gz
asset_name: ethdo-${RELEASE_TAG}-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