Merge branch 'luxtracon-pr443' into dev #420
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: Artifacts CD | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
- dev | |
paths-ignore: | |
- '**.md' | |
jobs: | |
frontend: | |
name: Build Frontend Artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up NodeJS | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
working-directory: ./web | |
run: yarn | |
- name: Build Web App | |
working-directory: ./web | |
run: yarn run build --base=/ | |
- name: Upload Artifcats | |
uses: actions/upload-artifact@v2 | |
with: | |
name: frontend | |
path: web/dist/web | |
backend: | |
name: Build Backend Artifacts | |
runs-on: ubuntu-latest | |
needs: | |
- frontend | |
strategy: | |
matrix: | |
goos: | |
- linux | |
- windows | |
- darwin | |
goarch: | |
- amd64 | |
- arm64 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: '^1.20' | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Retrieve frontend files | |
uses: actions/download-artifact@v2 | |
with: | |
name: frontend | |
path: internal/util/embedded/webdist | |
- name: Get dependencies | |
run: go get -v ./... | |
- name: Populate info embeds | |
run: bash ./ci/populateinfo.sh | |
- name: Build Backend (${{ matrix.goos }}-${{ matrix.goarch }}) | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
run: go build -o ./bin/shinpuru-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/shinpuru/main.go | |
- name: Rename Windows Binary | |
if: ${{ matrix.goos == 'windows' }} | |
env: | |
FNAME: ./bin/shinpuru-${{ matrix.goos }}-${{ matrix.goarch }} | |
run: mv ${{ env.FNAME }} ${{ env.FNAME }}.exe | |
- name: Upload Artifcats | |
uses: actions/upload-artifact@v2 | |
with: | |
name: shinpuru-${{ matrix.goos }}-${{ matrix.goarch }} | |
path: bin/ |