fix go.yml #28
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
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
name: Go | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: [ "main" ] | ||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: get_version | ||
if: contains(github.ref, 'tags/') | ||
name: Get version | ||
uses: jannemattila/get-version-from-tag@v3 | ||
- id: set_version | ||
if: contains(github.ref, 'tags/') | ||
name: Set version | ||
run: VERSION=$(echo "${{ steps.get_version.outputs.version }}") | ||
- id: set_version_default | ||
if: '!contains(github.ref, "tags/")' | ||
Check failure on line 32 in .github/workflows/go.yml GitHub Actions / GoInvalid workflow file
|
||
name: Set version | ||
run: VERSION=0.0.0-dev | ||
- name: Check out winrt-go fork | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: balazsgrill/winrt-go | ||
path: winrt-go | ||
- name: enable Projection FS | ||
run: Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.23' | ||
- name: Get tools | ||
run: | | ||
go install github.com/akavel/rsrc@latest | ||
- name: Test | ||
run: go test -v ./... | ||
- name: Generate | ||
run: go generate ./... | ||
- name: Build | ||
run: go build -o potatodrive.exe -ldflags="-H windowsgui -X 'main.Version=$VERSION'" ./cmd/main | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: potatodrive.exe | ||
path: potatodrive.exe | ||
- name: Setup dotnet | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: 5.x | ||
- name: Install wix | ||
run: | | ||
dotnet tool install --global wix | ||
- name: Create installer | ||
run: wix build PotatoDrive.wxs -arch x64 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: PotatoDrive.msi | ||
path: PotatoDrive.msi | ||
- name: release | ||
uses: ncipollo/release-action@v1 | ||
id: create_release | ||
with: | ||
allowUpdates: true | ||
draft: false | ||
prerelease: false | ||
name: ${{ github.ref_name }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
- name: upload HTML report | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: PotatoDrive.msi | ||
asset_name: Windows 64 bit installer | ||
asset_content_type: application/x-msi |