Linux Release #122
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: Linux Release | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
env: | |
CGO_ENABLED: 1 | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- amd64 | |
- arm64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ secrets.GH_REPO }} | |
token: ${{ secrets.GH_PAT }} | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
check-latest: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
cache: 'yarn' | |
cache-dependency-path: web/yarn.lock | |
- name: Install dependencies for arm64 | |
if: matrix.platform == 'arm64' | |
run: | | |
sudo apt-get update | |
sudo apt install gcc-aarch64-linux-gnu | |
- name: Build frontend | |
run: | | |
yarn install --frozen-lockfile --non-interactive | |
yarn quasar build | |
cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/ | |
working-directory: ./web | |
- name: Build | |
run: | | |
go mod download | |
if [ "${{ matrix.platform }}" == "arm64" ]; then | |
export CC=aarch64-linux-gnu-gcc | |
fi | |
GOARCH=${{ matrix.platform }} go build -ldflags '-s -w -extldflags "-static"' -o kikoeru | |
- name: Package | |
run: | | |
dist="kikoeru-linux-${{ matrix.platform }}" | |
mkdir $dist | |
cp kikoeru $dist | |
tar zcf "$dist.tar.gz" $dist | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: v0.0.1 | |
tag_name: v0.0.1 | |
body: | | |
When updating to a new version, the database schema may not be compatible, please delete `data/kikoeru.db` and re-sync works metadata. | |
files: | | |
kikoeru-*.* |