feat: add HP 12c Platinum g-shift key labels and backspace (#16) #50
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: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - id: release | |
| uses: googleapis/release-please-action@v5 | |
| with: | |
| token: ${{ secrets.RELEASES_GITHUB_TOKEN }} | |
| build: | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| strategy: | |
| matrix: | |
| include: | |
| - runner: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| platform: Linux_x86_64 | |
| - runner: ubuntu-24.04-arm | |
| goos: linux | |
| goarch: arm64 | |
| platform: Linux_arm64 | |
| - runner: macos-latest | |
| goos: darwin | |
| goarch: arm64 | |
| platform: Darwin_arm64 | |
| - runner: windows-latest | |
| goos: windows | |
| goarch: amd64 | |
| platform: Windows_x86_64 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: go.mod | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - if: runner.os == 'Linux' | |
| uses: actions/cache@v6 | |
| with: | |
| path: /var/cache/apt/archives | |
| key: apt-gtk-webkit-${{ runner.os }}-${{ runner.arch }} | |
| restore-keys: apt-gtk-webkit- | |
| - if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libgtk-4-dev libwebkitgtk-6.0-dev | |
| - run: | | |
| cd frontend | |
| npm ci | |
| npm run build | |
| cd .. | |
| - name: Build binary | |
| shell: bash | |
| env: | |
| CGO_ENABLED: "1" | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| run: | | |
| binary="Dozen" | |
| if [ "${{ matrix.goos }}" = "windows" ]; then binary="Dozen.exe"; fi | |
| go build -tags production -trimpath -ldflags="-w -s" -o "$binary" . | |
| - name: Package | |
| shell: bash | |
| run: | | |
| name="dozen_${{ matrix.platform }}" | |
| mkdir "$name" | |
| if [ "${{ runner.os }}" = "macOS" ]; then | |
| qlmanage -t -s 1024 -o . build/appicon.svg | |
| mv appicon.svg.png build/appicon.png | |
| mkdir -p "$name/Dozen.app/Contents/MacOS" | |
| mkdir -p "$name/Dozen.app/Contents/Resources" | |
| cp Dozen "$name/Dozen.app/Contents/MacOS/Dozen" | |
| chmod +x "$name/Dozen.app/Contents/MacOS/Dozen" | |
| cp build/darwin/Info.plist "$name/Dozen.app/Contents/Info.plist" | |
| mkdir -p tmp.iconset | |
| sips -z 16 16 build/appicon.png --out tmp.iconset/icon_16x16.png | |
| sips -z 32 32 build/appicon.png --out tmp.iconset/icon_16x16@2x.png | |
| sips -z 32 32 build/appicon.png --out tmp.iconset/icon_32x32.png | |
| sips -z 64 64 build/appicon.png --out tmp.iconset/icon_32x32@2x.png | |
| sips -z 128 128 build/appicon.png --out tmp.iconset/icon_128x128.png | |
| sips -z 256 256 build/appicon.png --out tmp.iconset/icon_128x128@2x.png | |
| sips -z 256 256 build/appicon.png --out tmp.iconset/icon_256x256.png | |
| sips -z 512 512 build/appicon.png --out tmp.iconset/icon_256x256@2x.png | |
| sips -z 512 512 build/appicon.png --out tmp.iconset/icon_512x512.png | |
| iconutil -c icns tmp.iconset | |
| cp tmp.icns "$name/Dozen.app/Contents/Resources/icon.icns" | |
| rm -rf tmp.iconset tmp.icns | |
| elif [ -f Dozen.exe ]; then | |
| cp Dozen.exe "$name/" | |
| else | |
| cp Dozen "$name/" | |
| fi | |
| cp README.md "$name/" 2>/dev/null || true | |
| if [ "${{ runner.os }}" = "Windows" ]; then | |
| 7z a "${name}.zip" "$name" | |
| else | |
| tar czf "${name}.tar.gz" "$name" | |
| fi | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: dozen-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: | | |
| *.tar.gz | |
| *.zip | |
| retention-days: 1 | |
| upload: | |
| needs: [release-please, build] | |
| if: always() && needs.build.result == 'success' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| path: artifacts | |
| pattern: dozen-* | |
| merge-multiple: true | |
| - run: cd artifacts && sha256sum *.tar.gz *.zip > checksums.txt 2>/dev/null; true | |
| - env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release upload "${{ needs.release-please.outputs.tag }}" \ | |
| artifacts/*.tar.gz \ | |
| artifacts/*.zip \ | |
| artifacts/checksums.txt --clobber |