Skip to content

Commit

Permalink
Switched to windows runtime to work around transip/gotransip#33
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvalk committed Jun 12, 2020
1 parent b6c78fe commit 4229806
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
id: ${{ steps.create_release.outputs.id }}
html_url: ${{ steps.create_release.outputs.html_url }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag: ${{ steps.version.outputs.value }}
steps:

# Obtain the tag version
Expand All @@ -38,7 +39,7 @@ jobs:
# Now we build each version and add it to the GitHub release
build:
needs: release
runs-on: ubuntu-latest
runs-on: windows-latest
name: Build for ${{ matrix.os }}/${{ matrix.arch }}
strategy:
matrix:
Expand Down Expand Up @@ -70,23 +71,15 @@ jobs:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-${{ hashFiles('**/go.sum') }}

# Obtain the tag version
- id: version
run: echo ::set-output name=value::${GITHUB_REF#refs/tags/}

# Setting the extension of the output file
- id: extension
run: |
if [ "${{ matrix.os }}" == "windows" ]; then
echo ::set-output name=value::.exe
else
echo ::set-output name=value::
fi
echo "::set-output name=value::$(If ('${{ matrix.os }}' -Eq 'windows') {'.exe'} Else {''})"
# Perform the actual build
- run: >-
go build
-o "${{ env.name }}_v${{ steps.version.outputs.value }}${{ steps.extension.outputs.value }}"
-o "${{ env.name }}_v${{ needs.release.outputs.tag }}${{ steps.extension.outputs.value }}"
env:
GO111MODULE: 'on'
GOOS: ${{ matrix.os }}
Expand All @@ -95,7 +88,7 @@ jobs:
# Zip it up so we can rename the artifact while keeping correct name of terraform provider
- run: >-
zip --junk-paths build.zip "${{ env.name }}_v${{ steps.version.outputs.value }}${{ steps.extension.outputs.value }}"
zip --junk-paths build.zip "${{ env.name }}_v${{ needs.release.outputs.tag }}${{ steps.extension.outputs.value }}"
# Upload the artifact
- uses: actions/upload-release-asset@v1
Expand All @@ -104,5 +97,5 @@ jobs:
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: build.zip
asset_name: ${{ env.name }}-${{ steps.version.outputs.value }}-${{ matrix.os }}-${{ matrix.arch }}.zip
asset_name: ${{ env.name }}-${{ needs.release.outputs.tag }}-${{ matrix.os }}-${{ matrix.arch }}.zip
asset_content_type: application

0 comments on commit 4229806

Please sign in to comment.