mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
update build workflow
This commit is contained in:
parent
35850d6310
commit
749d7b682e
170
.github/workflows/build.yml
vendored
170
.github/workflows/build.yml
vendored
@ -11,114 +11,114 @@ jobs:
|
|||||||
name: Build for MacOS
|
name: Build for MacOS
|
||||||
runs-on: macos-13
|
runs-on: macos-13
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: "Setup Go"
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '^1.18'
|
go-version: '^1.18'
|
||||||
- name: "Build"
|
- name: Build arm64 gui
|
||||||
run: make build_macos
|
uses: ./.github/actions/build.yml
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: macos
|
id: darwin_arm64_gui
|
||||||
path: _output/macos/yarr.app
|
cmd: make darwin_arm64_gui
|
||||||
|
out: out/darwin_arm64_gui/yarr.app
|
||||||
|
- name: Build amd64 gui
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
|
with:
|
||||||
|
id: darwin_amd64_gui
|
||||||
|
cmd: make darwin_amd64_gui
|
||||||
|
out: out/darwin_amd64_gui/yarr.app
|
||||||
|
- name: Build arm64
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
|
with:
|
||||||
|
id: darwin_arm64
|
||||||
|
cmd: make darwin_arm64
|
||||||
|
out: out/darwin_arm64/yarr
|
||||||
|
- name: Build amd64
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
|
with:
|
||||||
|
id: darwin_amd64
|
||||||
|
cmd: make darwin_amd64
|
||||||
|
out: out/darwin_amd64/yarr
|
||||||
|
|
||||||
build_windows:
|
build_windows:
|
||||||
name: Build for Windows
|
name: Build for Windows
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: "Setup Go"
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '^1.18'
|
go-version: '^1.18'
|
||||||
- name: "Build"
|
- name: Setup Zig
|
||||||
run: make build_windows
|
uses: mlugg/setup-zig@v1
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: windows
|
version: 0.14.0
|
||||||
path: _output/windows/yarr.exe
|
- name: Build arm64 gui
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
|
with:
|
||||||
|
id: windows_arm64_gui
|
||||||
|
cmd: make windows_arm64_gui
|
||||||
|
out: out/windows_arm64_gui/yarr.app
|
||||||
|
- name: Build amd64 gui
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
|
with:
|
||||||
|
id: windows_amd64_gui
|
||||||
|
cmd: make windows_amd64_gui
|
||||||
|
out: out/windows_amd64_gui/yarr.app
|
||||||
|
- name: Build arm64
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
|
with:
|
||||||
|
id: windows_arm64
|
||||||
|
cmd: make windows_arm64
|
||||||
|
out: out/windows_arm64/yarr
|
||||||
|
- name: Build amd64
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
|
with:
|
||||||
|
id: windows_amd64
|
||||||
|
cmd: make windows_amd64
|
||||||
|
out: out/windows_amd64/yarr
|
||||||
|
|
||||||
build_linux:
|
build_linux:
|
||||||
name: Build for Linux
|
name: Build for Linux
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: "Setup Go"
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '^1.18'
|
go-version: '^1.18'
|
||||||
- name: "Build"
|
- name: Setup Zig
|
||||||
run: make build_linux
|
uses: mlugg/setup-zig@v1
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: linux
|
version: 0.14.0
|
||||||
path: _output/linux/yarr
|
- name: Build amd64
|
||||||
|
uses: ./.github/actions/build.yml
|
||||||
build_linux-arm:
|
|
||||||
name: Build for Linux ARM
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- name: Install dependencies
|
|
||||||
run: >
|
|
||||||
sudo apt-get install -y
|
|
||||||
gcc-arm-linux-gnueabihf
|
|
||||||
libc6-dev-armhf-cross
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: "Setup Go"
|
|
||||||
uses: actions/setup-go@v4
|
|
||||||
with:
|
with:
|
||||||
go-version: '^1.18'
|
id: windows_amd64
|
||||||
- name: "Build"
|
cmd: make windows_amd64
|
||||||
env:
|
out: out/windows_amd64/yarr
|
||||||
CC: arm-linux-gnueabihf-gcc
|
- name: Build arm64
|
||||||
GOARCH: arm
|
uses: ./.github/actions/build.yml
|
||||||
GOARM: 7
|
|
||||||
run: make build_linux
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: linux_arm
|
id: windows_arm64
|
||||||
path: _output/linux/yarr
|
cmd: make windows_arm64
|
||||||
|
out: out/windows_arm64/yarr
|
||||||
build_linux-arm64:
|
- name: Build armv7
|
||||||
name: Build for Linux ARM64
|
uses: ./.github/actions/build.yml
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- name: Install dependencies
|
|
||||||
run: >
|
|
||||||
sudo apt-get install -y
|
|
||||||
gcc-aarch64-linux-gnu
|
|
||||||
libc6-dev-arm64-cross
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: "Setup Go"
|
|
||||||
uses: actions/setup-go@v4
|
|
||||||
with:
|
with:
|
||||||
go-version: '^1.18'
|
id: windows_armv7
|
||||||
- name: "Build"
|
cmd: make windows_armv7
|
||||||
env:
|
out: out/windows_armv7/yarr
|
||||||
CC: aarch64-linux-gnu-gcc
|
|
||||||
GOARCH: arm64
|
|
||||||
run: make build_linux
|
|
||||||
- name: Upload
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: linux_arm64
|
|
||||||
path: _output/linux/yarr
|
|
||||||
|
|
||||||
create_release:
|
create_release:
|
||||||
name: Create Release
|
name: Create Release
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'test') }}
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
needs: [build_macos, build_windows, build_linux, build_linux-arm, build_linux-arm64]
|
needs: [build_macos, build_windows, build_linux]
|
||||||
steps:
|
steps:
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@v4.1.7
|
uses: actions/download-artifact@v4.1.7
|
||||||
@ -127,26 +127,12 @@ jobs:
|
|||||||
- name: Preparation
|
- name: Preparation
|
||||||
run: |
|
run: |
|
||||||
ls -R
|
ls -R
|
||||||
chmod u+x macos/Contents/MacOS/yarr
|
|
||||||
chmod u+x linux/yarr
|
|
||||||
chmod u+x linux_arm/yarr
|
|
||||||
chmod u+x linux_arm64/yarr
|
|
||||||
|
|
||||||
mv macos yarr.app && zip -r yarr-${GITHUB_REF_NAME}-macos64.zip yarr.app
|
|
||||||
( cd windows && zip ../yarr-${GITHUB_REF_NAME}-windows64.zip yarr.exe )
|
|
||||||
( cd linux && zip ../yarr-${GITHUB_REF_NAME}-linux64.zip yarr )
|
|
||||||
( cd linux_arm && zip ../yarr-${GITHUB_REF_NAME}-linux_arm.zip yarr )
|
|
||||||
( cd linux_arm64 && zip ../yarr-${GITHUB_REF_NAME}-linux_arm64.zip yarr )
|
|
||||||
- name: Upload Release
|
- name: Upload Release
|
||||||
|
if: false
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
draft: true
|
draft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |
|
files: *.zip
|
||||||
yarr-${{ github.ref_name }}-macos64.zip
|
|
||||||
yarr-${{ github.ref_name }}-windows64.zip
|
|
||||||
yarr-${{ github.ref_name }}-linux64.zip
|
|
||||||
yarr-${{ github.ref_name }}-linux_arm.zip
|
|
||||||
yarr-${{ github.ref_name }}-linux_arm64.zip
|
|
||||||
|
23
.github/workflows/step-build.yml
vendored
Normal file
23
.github/workflows/step-build.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: Build & Upload
|
||||||
|
inputs:
|
||||||
|
id:
|
||||||
|
description: artifact name
|
||||||
|
required: true
|
||||||
|
cmd:
|
||||||
|
description: command to run
|
||||||
|
required: true
|
||||||
|
out:
|
||||||
|
description: path to output file
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: compile
|
||||||
|
run: ${{ inputs.cmd }}
|
||||||
|
- name: archive
|
||||||
|
run: tar -cvf ${{ out }}.tar ${{ out }}
|
||||||
|
- name: upload
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ${{ id }}
|
||||||
|
path: ${{ out }}.tar
|
12
makefile
12
makefile
@ -35,12 +35,12 @@ host:
|
|||||||
go build $(GO_FLAGS) -o out/yarr ./cmd/yarr
|
go build $(GO_FLAGS) -o out/yarr ./cmd/yarr
|
||||||
|
|
||||||
darwin_amd64:
|
darwin_amd64:
|
||||||
# not supported yet
|
# cross-compilation not supported: CC="zig cc -target x86_64-macos-none"
|
||||||
# CC="zig cc -target x86_64-macos-none" GOOS=darwin GOARCH=arm64 go build $(subst -s ,,$(GO_FLAGS)) -o out/$@/yarr ./cmd/yarr
|
GOOS=darwin GOARCH=arm64 go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr
|
||||||
|
|
||||||
darwin_arm64:
|
darwin_arm64:
|
||||||
# not supported yet
|
# cross-compilation not supported: CC="zig cc -target aarch64-macos-none"
|
||||||
# CC="zig cc -target aarch64-macos-none" GOOS=darwin GOARCH=arm64 go build $(subst -s ,,$(GO_FLAGS)) -o out/$@/yarr ./cmd/yarr
|
GOOS=darwin GOARCH=arm64 go build $(GO_FLAGS) -o out/$@/yarr ./cmd/yarr
|
||||||
|
|
||||||
linux_amd64:
|
linux_amd64:
|
||||||
CC="zig cc -target x86_64-linux-musl -O2 -g0" CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux GOARCH=amd64 \
|
CC="zig cc -target x86_64-linux-musl -O2 -g0" CGO_CFLAGS="-D_LARGEFILE64_SOURCE" GOOS=linux GOARCH=amd64 \
|
||||||
@ -69,10 +69,10 @@ darwin_amd64_gui: etc/icon.icns
|
|||||||
./etc/macos_package.sh $(VERSION) etc/icon.icns out/$@/yarr out/$@
|
./etc/macos_package.sh $(VERSION) etc/icon.icns out/$@/yarr out/$@
|
||||||
|
|
||||||
windows_amd64_gui: windows_versioninfo
|
windows_amd64_gui: windows_versioninfo
|
||||||
GOOS=windows GOARCH=amd64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr ./cmd/yarr
|
GOOS=windows GOARCH=amd64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr.exe ./cmd/yarr
|
||||||
|
|
||||||
windows_arm64_gui: src/platform/versioninfo.rc
|
windows_arm64_gui: src/platform/versioninfo.rc
|
||||||
GOOS=windows GOARCH=arm64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr ./cmd/yarr
|
GOOS=windows GOARCH=arm64 go build $(GO_FLAGS_GUI_WIN) -o out/$@/yarr.exe ./cmd/yarr
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
go run $(GO_FLAGS) ./cmd/yarr -db local.db
|
go run $(GO_FLAGS) ./cmd/yarr -db local.db
|
||||||
|
Loading…
x
Reference in New Issue
Block a user