Update build.yml #69
This file contains hidden or 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: Build a release | |
| on: | |
| push: | |
| branches: | |
| - release-* | |
| # on: | |
| # workflow_run: | |
| # workflows: ["Bump Version"] # Name of the workflow in bump-version.yml | |
| # types: | |
| # - completed | |
| # | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 | |
| - name: Set up Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: 1.21 | |
| - name: Build | |
| id: build | |
| run: | | |
| TAG=v$(awk -F'"' '/var GATESENTRY_VERSION =/ { print $2 }' main.go) | |
| mkdir bin | |
| go get -v | |
| ls -la | |
| cd ui && npm install && npm run build && cd .. | |
| ls | |
| rm -rf application/webserver/frontend/files/* | |
| mv ui/dist/* application/webserver/frontend/files | |
| mv application/webserver/frontend/files/fs/* application/webserver/frontend/files | |
| env GOOS=linux GOARCH=amd64 go build -o gatesentry-linux | |
| env GOOS=darwin GOARCH=amd64 go build -o gatesentry-macos | |
| env GOOS=windows GOARCH=amd64 go build -o gatesentry-windows.exe | |
| env GOOS=linux GOARCH=arm64 go build -o gatesentry-linux-arm64 | |
| chmod +x gatesentry-linux | |
| chmod +x gatesentry-macos | |
| git config user.name "GitHub Action" | |
| git config user.email "[email protected]" | |
| echo "$TAG" | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| - name: Setup Inno Setup | |
| run: | | |
| docker container create --name setup amake/innosetup installer.iss | |
| docker cp ./scripts/installer.iss setup:/work/ | |
| docker cp ./gatesentry-windows.exe setup:/work/ | |
| docker start -i -a setup | |
| docker cp setup:/work/Output/. . | |
| docker rm setup | |
| - name: Create Tag | |
| uses: cardinalby/git-tag-action@master | |
| env: | |
| TAG: ${{ steps.build.outputs.tag }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.build.outputs.tag }} | |
| files: | | |
| gatesentry-linux | |
| gatesentry-macos | |
| gatesentry-windows.exe | |
| gatesentry-linux-arm64 | |
| GatesentrySetup.exe |