mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 15:37:33 +08:00
upgrade github actions
This commit is contained in:
@@ -3,81 +3,78 @@ name: Build docker image and package for linux
|
||||
inputs:
|
||||
release-build:
|
||||
required: false
|
||||
type: string
|
||||
description: "Whether to build the linux package in release mode. If set to '1', the package will be built in release mode. Otherwise, it will be built in development mode."
|
||||
build-unix-time:
|
||||
required: false
|
||||
type: string
|
||||
description: "The unix time to use for building the linux package. The value should be a string representing the unix time in seconds."
|
||||
build-date:
|
||||
required: false
|
||||
type: string
|
||||
description: "The date to use for building the linux package. The value should be a string representing the date in the format of 'YYYYMMDD'."
|
||||
check-3rd-api:
|
||||
required: false
|
||||
type: string
|
||||
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
|
||||
type: string
|
||||
description: "Whether to skip tests when building the linux package. If set to '1', the tests will be skipped. Otherwise, the tests will be run."
|
||||
platform:
|
||||
required: true
|
||||
type: string
|
||||
description: "The platform to build the linux package for. The value should be in the format of 'os/arch[/variant]'. For example, 'linux/amd64', 'linux/arm64/v8', 'linux/arm/v7', or 'linux/arm/v6'."
|
||||
platform-name:
|
||||
required: true
|
||||
type: string
|
||||
description: "The name of the platform to build the linux package for. The value should be a string that can be used in file names. For example, 'linux-amd64', 'linux-arm64', 'linux-armv7', or 'linux-armv6'."
|
||||
docker-push:
|
||||
required: true
|
||||
type: boolean
|
||||
description: "Whether to push the built docker image to the registry. If set to 'true', the image will be pushed. Otherwise, it will not be pushed."
|
||||
docker-image-name:
|
||||
required: true
|
||||
type: string
|
||||
required: false
|
||||
description: "The repository name of the docker image to build. This is required if 'docker-push' is set to 'true'."
|
||||
docker-username:
|
||||
required: false
|
||||
type: string
|
||||
description: "Username for logging in to the docker registry. This is required if 'docker-push' is set to 'true'."
|
||||
docker-password:
|
||||
required: false
|
||||
type: string
|
||||
description: "Password for logging in to the docker registry. This is required if 'docker-push' is set to 'true'."
|
||||
docker-bake-meta-file-path:
|
||||
required: true
|
||||
type: string
|
||||
description: "The file path to the docker bake meta file."
|
||||
docker-bake-meta-artifact-name:
|
||||
required: true
|
||||
type: string
|
||||
description: "The name of the artifact that contains the docker bake meta file."
|
||||
docker-bake-digests-file-path:
|
||||
required: true
|
||||
type: string
|
||||
description: "The file path to save the docker bake digests file. The file will be created with the name of the digest under this path."
|
||||
docker-bake-digests-artifact-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: "The prefix for the docker bake digests artifact name."
|
||||
package-file-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
package-artifact-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: "The prefix for the linux package file name."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: docker/setup-qemu-action@v4
|
||||
|
||||
- name: Download docker bake meta artifact
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ inputs.docker-bake-meta-artifact-name }}
|
||||
path: ${{ runner.temp }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: ${{ inputs.docker-username != '' && inputs.docker-password != '' }}
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ inputs.docker-username }}
|
||||
password: ${{ inputs.docker-password }}
|
||||
|
||||
- name: Build docker for ${{ inputs.platform-name }}
|
||||
id: bake
|
||||
uses: docker/bake-action@v6
|
||||
uses: docker/bake-action@v7
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
@@ -110,15 +107,15 @@ runs:
|
||||
tar -czf ${{ runner.temp }}/${{ inputs.package-file-name-prefix }}-${{ inputs.platform-name }}.tar.gz *
|
||||
|
||||
- name: Upload ${{ inputs.platform-name }} digests artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ inputs.docker-bake-digests-artifact-name-prefix }}-${{ inputs.platform-name }}
|
||||
path: ${{ inputs.docker-bake-digests-file-path }}/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload artifact for ${{ inputs.platform-name }}
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ inputs.package-artifact-name-prefix }}-${{ inputs.platform-name }}
|
||||
archive: false
|
||||
path: ${{ runner.temp }}/${{ inputs.package-file-name-prefix }}-${{ inputs.platform-name }}.tar.gz
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -3,31 +3,34 @@ name: Build backend file for windows
|
||||
inputs:
|
||||
go-version:
|
||||
required: false
|
||||
description: "The Go version to use for building the windows backend. The version should be in the format of 'x.y.z'."
|
||||
default: "1.26.2"
|
||||
mingw-version:
|
||||
required: false
|
||||
description: "The MinGW version to use for building the windows backend. The version should be in the format of 'x.y.z'."
|
||||
default: "15.2.0"
|
||||
mingw-revison:
|
||||
required: false
|
||||
description: "The MinGW revision to use for building the windows backend. The revision should be in the format of 'vX-revY'."
|
||||
default: "v13-rev1"
|
||||
release-build:
|
||||
required: false
|
||||
type: string
|
||||
description: "Whether to build the windows 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
|
||||
type: string
|
||||
description: "The unix time to use for building the windows backend. The value should be a string representing the unix time in seconds."
|
||||
build-date:
|
||||
required: false
|
||||
type: string
|
||||
description: "The date to use for building the windows backend. The value should be a string representing the date in the format of 'YYYYMMDD'."
|
||||
check-3rd-api:
|
||||
required: false
|
||||
type: string
|
||||
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
|
||||
type: string
|
||||
description: "Whether to skip tests when building the windows backend. If set to '1', the tests will be skipped. Otherwise, the tests will be run."
|
||||
backend-artifact-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: "The prefix for the windows backend artifact name."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@@ -69,7 +72,7 @@ runs:
|
||||
.\build.ps1 backend
|
||||
|
||||
- name: Upload windows backend artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ inputs.backend-artifact-name-prefix }}-windows-x64
|
||||
path: ezbookkeeping.exe
|
||||
|
||||
@@ -3,27 +3,24 @@ name: Build packages for windows
|
||||
inputs:
|
||||
package-file-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
package-artifact-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: "The prefix for the windows package file name."
|
||||
backend-artifact-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: "The prefix for the windows backend artifact name."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download windows-x64 backend file
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ inputs.backend-artifact-name-prefix }}-windows-x64
|
||||
path: ${{ runner.temp }}\backend
|
||||
|
||||
- name: Download linux-amd64 packaged files
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ inputs.package-artifact-name-prefix }}-linux-amd64
|
||||
name: ${{ inputs.package-file-name-prefix }}-linux-amd64.tar.gz
|
||||
path: ${{ runner.temp }}\package
|
||||
|
||||
- name: Extract frontend files from linux-amd64 package
|
||||
@@ -50,8 +47,8 @@ runs:
|
||||
Remove-Item -Recurse -Force ezbookkeeping
|
||||
|
||||
- name: Upload windows artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ inputs.package-artifact-name-prefix }}-windows-x64
|
||||
archive: false
|
||||
path: ${{ inputs.package-file-name-prefix }}-windows-x64.zip
|
||||
if-no-files-found: error
|
||||
|
||||
@@ -3,50 +3,50 @@ name: Push linux docker multi-arch image to registry
|
||||
inputs:
|
||||
docker-image-name:
|
||||
required: true
|
||||
type: string
|
||||
description: "The repository name of the docker image to build."
|
||||
docker-username:
|
||||
required: true
|
||||
type: string
|
||||
description: "Username for logging in to the docker registry."
|
||||
docker-password:
|
||||
required: true
|
||||
type: string
|
||||
description: "Password for logging in to the docker registry."
|
||||
docker-bake-meta-file-path:
|
||||
required: true
|
||||
type: string
|
||||
description: "The file path to the docker bake meta file."
|
||||
docker-bake-meta-artifact-name:
|
||||
required: true
|
||||
type: string
|
||||
description: "The name of the artifact that contains the docker bake meta file."
|
||||
docker-bake-digests-file-path:
|
||||
required: true
|
||||
type: string
|
||||
description: "The file path to save the docker bake digests file. The file will be created with the name of the digest under this path."
|
||||
docker-bake-digests-artifact-name-prefix:
|
||||
required: true
|
||||
type: string
|
||||
description: "The prefix for the docker bake digests artifact name."
|
||||
docker-image-tags:
|
||||
required: true
|
||||
type: string
|
||||
description: "The tags for the docker image to push."
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Download docker bake meta artifact
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ${{ inputs.docker-bake-meta-artifact-name }}
|
||||
path: ${{ runner.temp }}
|
||||
|
||||
- name: Download digests artifact
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: ${{ inputs.docker-bake-digests-artifact-name-prefix }}-*
|
||||
merge-multiple: true
|
||||
path: ${{ inputs.docker-bake-digests-file-path }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
username: ${{ inputs.docker-username }}
|
||||
password: ${{ inputs.docker-password }}
|
||||
|
||||
Reference in New Issue
Block a user