Skip to content

Linux Release

Linux Release #150

Workflow file for this run

name: Linux Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
toolchain: x86_64-linux-musl-cross
cc: x86_64-linux-musl-gcc
- arch: arm64
toolchain: aarch64-linux-musl-cross
cc: aarch64-linux-musl-gcc
steps:
- name: Install toolchains
run: |
curl -L -o "${{matrix.toolchain}}.tgz" "https://musl.cc/${{matrix.toolchain}}.tgz"
sudo tar xf "${{matrix.toolchain}}.tgz" --strip-components 1 -C /usr/local
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ secrets.GH_REPO }}
token: ${{ secrets.GH_PAT }}
fetch-depth: 0
- name: Get latest release version
run: |
echo "APP_VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: 'web/package.json'
check-latest: true
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Build frontend
run: |
pnpm install
pnpm build
cp -a dist/spa/. $GITHUB_WORKSPACE/public/dist/
working-directory: ./web
- name: Build
run: |
go mod download
export GOARCH=${{ matrix.arch }}
export CC=${{ matrix.cc }}
bash build.sh
- name: Package
run: |
dist="kikoeru-linux-${{ matrix.arch }}"
mkdir -p "$dist"
cp kikoeru scripts/start.sh "$dist/"
tar zcf "$dist.tar.gz" "$dist/"
- name: Publish
uses: softprops/action-gh-release@v2
with:
name: ${{ env.APP_VERSION }}
tag_name: ${{ env.APP_VERSION }}
draft: true
body: |
The releases are generated by GitHub Actions.
files: |
kikoeru-*.*