mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 15:07:33 +08:00
provide officially built macOS packages
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
name: Build backend file for macOS
|
||||
|
||||
inputs:
|
||||
go-version:
|
||||
required: false
|
||||
description: "The Go version to use for building the macOS backend. The version should be in the format of 'x.y.z'."
|
||||
default: "1.26.2"
|
||||
release-build:
|
||||
required: false
|
||||
description: "Whether to build the macOS backend in release mode. If set to '1', the backend will be built in release mode. Otherwise, it will be built in development mode."
|
||||
build-unix-time:
|
||||
required: false
|
||||
description: "The unix time to use for building the macOS backend. The value should be a string representing the unix time in seconds."
|
||||
build-date:
|
||||
required: false
|
||||
description: "The date to use for building the macOS backend. The value should be a string representing the date in the format of 'YYYYMMDD'."
|
||||
check-3rd-api:
|
||||
required: false
|
||||
description: "Whether to run integration tests that call third party APIs. If set to '1', the tests will be run. Otherwise, the tests will be skipped."
|
||||
skip-tests:
|
||||
required: false
|
||||
description: "Whether to skip tests when building the macOS backend. If set to '1', the tests will be skipped. Otherwise, the tests will be run."
|
||||
architecture:
|
||||
required: true
|
||||
description: "The name of the architecture to build the macOS package for."
|
||||
backend-artifact-name-prefix:
|
||||
required: true
|
||||
description: "The prefix for the macOS backend artifact name."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
|
||||
- name: Build backend for macOS-${{ inputs.architecture }}
|
||||
shell: bash
|
||||
env:
|
||||
RELEASE_BUILD: "${{ inputs.release-build }}"
|
||||
BUILD_PIPELINE: "1"
|
||||
BUILD_UNIXTIME: "${{ inputs.build-unix-time }}"
|
||||
BUILD_DATE: "${{ inputs.build-date }}"
|
||||
CHECK_3RD_API: "${{ inputs.check-3rd-api }}"
|
||||
SKIP_TESTS: "${{ inputs.skip-tests }}"
|
||||
run: |
|
||||
./build.sh backend
|
||||
|
||||
- name: Upload macOS-${{ inputs.architecture }} backend artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ inputs.backend-artifact-name-prefix }}-macos-${{ inputs.architecture }}
|
||||
path: ezbookkeeping
|
||||
if-no-files-found: error
|
||||
@@ -0,0 +1,58 @@
|
||||
name: Build packages for macOS
|
||||
|
||||
inputs:
|
||||
architecture:
|
||||
required: true
|
||||
description: "The name of the architecture to build the macOS package for."
|
||||
package-file-name-prefix:
|
||||
required: true
|
||||
description: "The prefix for the macOS package file name."
|
||||
backend-artifact-name-prefix:
|
||||
required: true
|
||||
description: "The prefix for the macOS backend artifact name."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download macOS-${{ inputs.architecture }} backend file
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ inputs.backend-artifact-name-prefix }}-macos-${{ inputs.architecture }}
|
||||
path: ${{ runner.temp }}/backend
|
||||
|
||||
- name: Download linux-amd64 packaged files
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ inputs.package-file-name-prefix }}-linux-amd64.tar.gz
|
||||
path: ${{ runner.temp }}/package
|
||||
|
||||
- name: Extract frontend files from linux-amd64 package
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p package
|
||||
tar -xzf ${{ runner.temp }}/package/${{ inputs.package-file-name-prefix }}-linux-amd64.tar.gz -C package
|
||||
|
||||
- name: Package macOS-${{ inputs.architecture }} package
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ezbookkeeping
|
||||
mkdir -p ezbookkeeping/data
|
||||
mkdir -p ezbookkeeping/storage
|
||||
mkdir -p ezbookkeeping/log
|
||||
cp ${{ runner.temp }}/backend/ezbookkeeping ezbookkeeping/
|
||||
cp -R package/public ezbookkeeping/public
|
||||
cp -R conf ezbookkeeping/conf
|
||||
cp -R templates ezbookkeeping/templates
|
||||
cp LICENSE ezbookkeeping/
|
||||
cd ezbookkeeping
|
||||
chmod +x ezbookkeeping
|
||||
tar -czf ${{ runner.temp }}/${{ inputs.package-file-name-prefix }}-macos-${{ inputs.architecture }}.tar.gz *
|
||||
cd ..
|
||||
rm -rf ezbookkeeping
|
||||
|
||||
- name: Upload macOS-${{ inputs.architecture }} artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
archive: false
|
||||
path: ${{ runner.temp }}/${{ inputs.package-file-name-prefix }}-macos-${{ inputs.architecture }}.tar.gz
|
||||
if-no-files-found: error
|
||||
@@ -128,6 +128,23 @@ jobs:
|
||||
skip-tests: ${{ vars.SKIP_TESTS }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-macos-backend:
|
||||
needs:
|
||||
- setup
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- uses: ./.github/actions/build-macos-backend
|
||||
with:
|
||||
architecture: arm64
|
||||
build-unix-time: ${{ needs.setup.outputs.build-unix-time }}
|
||||
build-date: ${{ needs.setup.outputs.build-date }}
|
||||
check-3rd-api: ${{ vars.CHECK_3RD_API }}
|
||||
skip-tests: ${{ vars.SKIP_TESTS }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-windows-package:
|
||||
needs:
|
||||
- setup
|
||||
@@ -142,3 +159,19 @@ jobs:
|
||||
with:
|
||||
package-file-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-package-file-name-prefix }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-macos-package:
|
||||
needs:
|
||||
- setup
|
||||
- build-macos-backend
|
||||
- build-linux-docker-and-package-x86
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- uses: ./.github/actions/build-macos-package
|
||||
with:
|
||||
architecture: arm64
|
||||
package-file-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-package-file-name-prefix }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
@@ -162,6 +162,24 @@ jobs:
|
||||
skip-tests: ${{ vars.SKIP_TESTS }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-macos-backend:
|
||||
needs:
|
||||
- setup
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- uses: ./.github/actions/build-macos-backend
|
||||
with:
|
||||
architecture: arm64
|
||||
release-build: 1
|
||||
build-unix-time: ${{ needs.setup.outputs.build-unix-time }}
|
||||
build-date: ${{ needs.setup.outputs.build-date }}
|
||||
check-3rd-api: ${{ vars.CHECK_3RD_API }}
|
||||
skip-tests: ${{ vars.SKIP_TESTS }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-windows-package:
|
||||
needs:
|
||||
- setup
|
||||
@@ -177,6 +195,22 @@ jobs:
|
||||
package-file-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-package-file-name-prefix }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-macos-package:
|
||||
needs:
|
||||
- setup
|
||||
- build-macos-backend
|
||||
- build-linux-docker-and-package-x86
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- uses: ./.github/actions/build-macos-package
|
||||
with:
|
||||
architecture: arm64
|
||||
package-file-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-package-file-name-prefix }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
publish-release:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
@@ -184,6 +218,7 @@ jobs:
|
||||
- build-linux-docker-and-package-x86
|
||||
- build-linux-docker-and-package-arm
|
||||
- build-windows-package
|
||||
- build-macos-package
|
||||
- push-linux-docker
|
||||
steps:
|
||||
- name: Download all packaged files
|
||||
|
||||
@@ -159,6 +159,23 @@ jobs:
|
||||
skip-tests: ${{ vars.SKIP_TESTS }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-macos-backend:
|
||||
needs:
|
||||
- setup
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- uses: ./.github/actions/build-macos-backend
|
||||
with:
|
||||
architecture: arm64
|
||||
build-unix-time: ${{ needs.setup.outputs.build-unix-time }}
|
||||
build-date: ${{ needs.setup.outputs.build-date }}
|
||||
check-3rd-api: ${{ vars.CHECK_3RD_API }}
|
||||
skip-tests: ${{ vars.SKIP_TESTS }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-windows-package:
|
||||
needs:
|
||||
- setup
|
||||
@@ -173,3 +190,19 @@ jobs:
|
||||
with:
|
||||
package-file-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-package-file-name-prefix }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
build-macos-package:
|
||||
needs:
|
||||
- setup
|
||||
- build-macos-backend
|
||||
- build-linux-docker-and-package-x86
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- uses: ./.github/actions/build-macos-package
|
||||
with:
|
||||
architecture: arm64
|
||||
package-file-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-package-file-name-prefix }}
|
||||
backend-artifact-name-prefix: ${{ needs.setup.outputs.ezbookkeeping-backend-artifact-name-prefix }}
|
||||
|
||||
Reference in New Issue
Block a user