alttp: wrap each checkbox label in a div to make the clickable labels… #629
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: Main | |
on: | |
push: | |
tags: [ 'v*' ] | |
branches: [ '*' ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
go-test: | |
name: Go Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- run: go test ./... | |
windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- goos: windows | |
goarch: amd64 | |
suffix: zip | |
- goos: windows | |
goarch: "386" | |
suffix: zip | |
- goos: windows | |
goarch: arm | |
suffix: zip | |
- goos: windows | |
goarch: arm64 | |
suffix: zip | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- run: echo "basename=o2-${{env.GITHUB_REF_SLUG}}-${{matrix.goos}}-${{matrix.goarch}}${{matrix.alt}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Build Web | |
run: | | |
cd webui/web | |
npm ci | |
npm run production | |
- name: Build App | |
run: | | |
Set-Item -Path Env:GOOS -Value "${{matrix.goos}}" | |
Set-Item -Path Env:GOARCH -Value "${{matrix.goarch}}" | |
go build -tags="${{ matrix.tags }}" -gcflags=all=-l -ldflags="-w -X 'main.version=${{env.GITHUB_REF_SLUG}}' -X 'main.commit=${{env.GITHUB_SHA_SHORT}}' -X 'main.date=$(date +'%Y-%m-%dT%H:%M:%S')' -X 'main.builtBy=$(go version | cut -f3 -d ' ')'" -o ./${{env.basename}}/o2.exe ./webui/o2 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{env.basename}} | |
path: ${{env.basename}}/ | |
- name: Package ${{env.basename}}.${{matrix.suffix}} for Windows | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
run: Compress-Archive -DestinationPath ${{env.basename}}.${{matrix.suffix}} -Path ${{env.basename}}/* | |
- name: Upload binaries to release | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.GITHUB_REF_SLUG }} | |
overwrite: true | |
asset_name: ${{env.basename}}.${{matrix.suffix}} | |
file: ${{ github.workspace }}/${{env.basename}}.${{matrix.suffix}} | |
macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- run: echo "basename=o2-${{env.GITHUB_REF_SLUG}}-darwin-universal" >> $GITHUB_ENV | |
- name: Build Web | |
run: cd webui/web && npm ci && npm run production | |
- name: Build App | |
run: > | |
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build | |
-gcflags=all=-l | |
-ldflags="-w -X 'main.version=${{env.GITHUB_REF_SLUG}}' -X 'main.commit=${{env.GITHUB_SHA_SHORT}}' -X 'main.date=$(date +'%Y-%m-%dT%H:%M:%S')'" | |
-o ./${{env.basename}}/o2.amd64 | |
./webui/o2 | |
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build | |
-gcflags=all=-l | |
-ldflags="-w -X 'main.version=${{env.GITHUB_REF_SLUG}}' -X 'main.commit=${{env.GITHUB_SHA_SHORT}}' -X 'main.date=$(date +'%Y-%m-%dT%H:%M:%S')'" | |
-o ./${{env.basename}}/o2.arm64 | |
./webui/o2 | |
lipo -create -output ./${{env.basename}}/o2 ./${{env.basename}}/o2.amd64 ./${{env.basename}}/o2.arm64 | |
rm -f ./${{env.basename}}/o2.amd64 ./${{env.basename}}/o2.arm64 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{env.basename}} | |
path: ${{env.basename}}/ | |
- name: Package ${{env.basename}}.tar.gz for MacOS | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
run: tar czf ${{env.basename}}.tar.gz ${{env.basename}}/ | |
- name: Upload binaries to release | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.GITHUB_REF_SLUG }} | |
overwrite: true | |
asset_name: ${{env.basename}}.tar.gz | |
file: ${{ github.workspace }}/${{env.basename}}.tar.gz | |
linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- goos: linux | |
goarch: amd64 | |
suffix: tar.xz | |
- goos: linux | |
goarch: amd64 | |
suffix: tar.xz | |
tags: notray | |
alt: -notray | |
## NOTE(2023-08-31): disabled arm64 builds due to cross-compilation error with systray package: | |
## # github.com/getlantern/systray | |
## In file included from /usr/aarch64-linux-gnu/include/features.h:510, | |
## from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, | |
## from /usr/aarch64-linux-gnu/include/stdlib.h:26, | |
## from _cgo_export.c:3: | |
## /usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: fatal error: gnu/stubs-32.h: No such file or directory | |
## 7 | # include <gnu/stubs-32.h> | |
## | ^~~~~~~~~~~~~~~~ | |
## compilation terminated. | |
#- goos: linux | |
# goarch: arm64 | |
# suffix: tar.xz | |
# linuxdeps: gcc-aarch64-linux-gnu libgtk-3-dev libayatana-appindicator3-dev | |
# gobuildenvs: CC=aarch64-linux-gnu-gcc | |
#- goos: linux | |
# goarch: arm64 | |
# suffix: tar.xz | |
# tags: notray | |
# alt: -notray | |
# linuxdeps: gcc-aarch64-linux-gnu | |
# gobuildenvs: CC=aarch64-linux-gnu-gcc | |
#- goos: linux | |
# goarch: "386" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- run: echo "basename=o2-${{env.GITHUB_REF_SLUG}}-${{matrix.goos}}-${{matrix.goarch}}${{matrix.alt}}" >> $GITHUB_ENV | |
- name: Build Web | |
run: cd webui/web && npm ci && npm run production | |
- name: Build App | |
run: > | |
CGO_ENABLED=1 GOOS=${{matrix.goos}} GOARCH=${{matrix.goarch}} ${{matrix.gobuildenvs}} go build | |
-tags="${{ matrix.tags }}" | |
-gcflags=all=-l | |
-ldflags="-w -X 'main.version=${{env.GITHUB_REF_SLUG}}' -X 'main.commit=${{env.GITHUB_SHA_SHORT}}' -X 'main.date=$(date +'%Y-%m-%dT%H:%M:%S')'" | |
-o ./${{env.basename}}/o2 | |
./webui/o2 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{env.basename}} | |
path: ${{env.basename}}/ | |
- name: Package ${{env.basename}}.${{matrix.suffix}} for Linux | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
run: tar cJf ${{env.basename}}.${{matrix.suffix}} ${{env.basename}}/ | |
- name: Upload binaries to release | |
if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.GITHUB_REF_SLUG }} | |
overwrite: true | |
asset_name: ${{env.basename}}.${{matrix.suffix}} | |
file: ${{ github.workspace }}/${{env.basename}}.${{matrix.suffix}} |