goreleaser

This commit is contained in:
Robert Janetzko 2022-05-10 17:47:51 +00:00
parent 2a02b4606d
commit 202ff3df6d
4 changed files with 51 additions and 24 deletions

View File

@ -21,4 +21,5 @@ USER vscode
# RUN npm install -g @angular/CLI # RUN npm install -g @angular/CLI
# [Optional] Uncomment this line to install global node packages. # [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
RUN go install github.com/tc-hib/go-winres@latest RUN go install github.com/tc-hib/go-winres@latest \
&& go install github.com/goreleaser/goreleaser@latest

View File

@ -3,8 +3,10 @@ name: Build LegendsBrowser
on: on:
push: push:
branches: [ master ] branches: [ master ]
tags: [ '**' ]
pull_request: pull_request:
branches: [ master ] branches: [ master ]
workflow_dispatch:
jobs: jobs:
@ -18,26 +20,26 @@ jobs:
with: with:
go-version: 1.18 go-version: 1.18
- name: Build MacOS - name: Build
run: cd backend && GOOS=darwin GOARCH=amd64 go build -o ../bin/legendsbrowser-mac-intel run: cd backend && go build -v ./...
- name: Build Linux
run: cd backend && GOOS=linux GOARCH=amd64 go build -o ../bin/legendsbrowser-linux-x64
- name: Build Windows
run: cd backend && GOOS=windows GOARCH=amd64 go build -o ../bin/legendsbrowser-win-x64.exe
- name: Upload MacOS Artifact release:
uses: actions/upload-artifact@v3 runs-on: ubuntu-latest
with: needs: [ build ]
name: mac-os if: ${{ startsWith(github.ref, 'refs/tags/') }}
path: bin/legendsbrowser-mac-intel steps:
- name: Upload Linux Artifact - uses: actions/checkout@v2
uses: actions/upload-artifact@v3
with: - name: Set up Go
name: linux uses: actions/setup-go@v2
path: bin/legendsbrowser-linux-x64 with:
- name: Upload MacOS Artifact go-version: 1.18
uses: actions/upload-artifact@v3
with: - name: Run GoReleaser
name: windows uses: goreleaser/goreleaser-action@v2
path: bin/legendsbrowser-win-x64.exe with:
version: latest
workdir: backend
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3
backend/.gitignore vendored
View File

@ -2,4 +2,5 @@ resources/frontend/*
same.json same.json
conf.json conf.json
_conf.json _conf.json
/*.png /*.png
dist/

23
backend/.goreleaser.yaml Normal file
View File

@ -0,0 +1,23 @@
builds:
- binary: legendsbrowser
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
archives:
- format: zip
name_template: "legendsbrowser-{{ .Version }}-{{ .Os }}"
replacements:
darwin: macos
linux: linux
windows: win
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'