Continuous Deployment #20
Workflow file for this run
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
name: Continuous Deployment | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publish-github: | |
name: Publish on Github | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build | |
run: | | |
$Env:PATH = "${Env:USERPROFILE}\go\bin;${Env:PATH}" | |
$version = ${Env:GITHUB_REF}.Replace("refs/tags/","") | |
$Env:GO_BUILD_OPTS = "-ldflags `"-w -s -X github.com/yuk7/wsldl/version.version=${version}`"" | |
$Env:PATH = "${Env:USERPROFILE}\go\bin;${Env:PATH}" | |
echo AMD64 build | |
.\build.bat all | |
move out out_amd64 | |
echo ARM64 build | |
$Env:GOARCH="arm64" | |
.\build.bat all | |
move out out_arm64 | |
- name: Zip package and rename | |
run: | | |
Compress-Archive -Path .\out_amd64\icons\* -DestinationPath .\out_amd64\icons.zip | |
move .\out_arm64\wsldl.exe .\out_arm64\wsldl_arm64.exe | |
Compress-Archive -Path .\out_arm64\icons\* -DestinationPath .\out_arm64\icons_arm64.zip | |
- name: Release body | |
run: | | |
$version = ${Env:GITHUB_REF}.Replace("refs/tags/","") | |
echo "![downloads](https://img.shields.io/github/downloads/yuk7/wsldl/${version}/total?style=flat-square)" > body.txt | |
- name: Upload the release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: body.txt | |
files: | | |
out_amd64/wsldl.exe | |
out_amd64/icons.zip | |
out_arm64/wsldl_arm64.exe | |
out_arm64/icons_arm64.zip | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |