dev: run the server in the foreground with an isolated runtime dir #2
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - { goos: linux, goarch: amd64, suffix: '' } | |
| - { goos: linux, goarch: arm64, suffix: '' } | |
| - { goos: darwin, goarch: amd64, suffix: '' } | |
| - { goos: darwin, goarch: arm64, suffix: '' } | |
| - { goos: windows, goarch: amd64, suffix: '.exe' } | |
| - { goos: windows, goarch: arm64, suffix: '.exe' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Build web UI | |
| run: | | |
| cd web | |
| npm ci | |
| npm run build | |
| rm -rf ../server/webdist && cp -r dist ../server/webdist | |
| - name: Build binary | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: '0' | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| OUT=enx-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }} | |
| go build -trimpath -ldflags "-s -w -X main.version=${VERSION}" -o dist/${OUT} ./cmd/enowx | |
| (cd dist && sha256sum ${OUT} > ${OUT}.sha256) | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: enx-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: dist/ | |
| retention-days: 1 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: dist/* |