feat: support AL and AC keycodes Karabiner does (#256) #130
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: Build & Release | |
on: push | |
jobs: | |
build: | |
name: Build | |
runs-on: macos-latest | |
steps: | |
- name: Setup GraalVM environment | |
uses: DeLaGuardo/setup-graalvm@master | |
with: | |
graalvm-version: "22.1.0.java17" | |
- uses: actions/cache@v3 | |
id: maven-cache # use this to check for `cache-hit` (`steps.yarn-and-maven-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ~/.m2/ | |
key: ${{ runner.os }}-maven-${{ hashFiles('./deps.edn') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Install native image | |
run: gu install native-image | |
- name: Setup Clojure | |
uses: DeLaGuardo/setup-clojure@master | |
with: | |
lein: latest | |
- name: Install joker | |
run: | | |
brew install candid82/brew/joker | |
- name: Checkout Code | |
uses: actions/checkout@v3.0.1 | |
- name: Install dependencies | |
run: lein deps | |
- name: Compile | |
run: make | |
- name: Test The Binary | |
run: make test-binary | |
- name: Create gokuw | |
run: | | |
touch gokuw | |
echo '#!/bin/sh' >> gokuw | |
echo 'watchexec -r -e edn -w `[[ -z $GOKU_EDN_CONFIG_FILE ]] && echo ~/.config/karabiner.edn || echo $GOKU_EDN_CONFIG_FILE` goku' >> gokuw | |
chmod +x gokuw | |
- name: Pack | |
run: zip -r goku.zip goku.zip goku gokuw # https://github.com/actions/virtual-environments/issues/2619#issuecomment-778827140 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: goku-zip | |
path: goku.zip | |
draft-release: | |
name: Draft Release | |
if: startsWith(github.ref, 'refs/heads/') | |
needs: build | |
runs-on: macos-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: goku-zip | |
- name: Delete Other Draft Releases | |
uses: hugo19941994/delete-draft-releases@v1.0.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get sha256 | |
id: sha256 | |
run: echo "::set-output name=checksum::$(shasum -a 256 goku.zip)" | |
- name: Create Draft Release | |
id: create_draft_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.sha }} | |
release_name: Release ${{ github.sha }} | |
body: | | |
- sha256 `${{ steps.sha256.outputs.checksum }}` | |
draft: true | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_draft_release.outputs.upload_url }} | |
asset_path: ./goku.zip | |
asset_name: goku.zip | |
asset_content_type: application/gzip | |
release: | |
name: Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: build | |
runs-on: macos-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: goku-zip | |
- name: Get sha256 | |
id: sha256 | |
run: echo "::set-output name=checksum::$(shasum -a 256 goku.zip)" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: | | |
Checkout the changelog at https://github.com/yqrashawn/GokuRakuJoudo/blob/master/CHANGELOG.org | |
- sha256 `${{ steps.sha256.outputs.checksum }}` | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./goku.zip | |
asset_name: goku.zip | |
asset_content_type: application/gzip |