release #36
Workflow file for this run
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: release | |
permissions: write-all | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest ] | |
go-version: [ '1.22' ] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: test env | |
run: | | |
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME" | |
echo "Tag name from github.ref_name: ${{ github.ref_name }}" | |
echo "Tag name from github.ref: ${{ github.ref }}" | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install dependencies | |
run: | | |
go get . | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to Tencent | |
uses: docker/login-action@v3 | |
with: | |
registry: registry.cn-hangzhou.aliyuncs.com | |
username: ${{ secrets.ALIYUN_USERNAME }} | |
password: ${{ secrets.ALIYUN_TOKEN }} | |
- name: Build | |
run: | | |
make clean-source | |
make build PROJECT_NAME=dpanel-amd64 CGO_ENABLED=1 | |
# arm64 | |
curl -Lo arm64.tar.xz https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz | |
tar -xf arm64.tar.xz | |
make build PROJECT_NAME=dpanel-arm64 CGO_ENABLED=1 GOARM=7 GOARCH=arm64 GOOS=linux \ | |
CC=${PWD}/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc \ | |
CXX=${PWD}/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++ | |
# armv7 | |
curl -Lo arm.tar.xz https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz | |
tar -xf arm.tar.xz | |
make build PROJECT_NAME=dpanel-arm CGO_ENABLED=1 GOARM=7 GOARCH=arm GOOS=linux \ | |
CC=${PWD}/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-gcc \ | |
CXX=${PWD}/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-g++ | |
# amd64-musl | |
curl -Lo amd64-musl.tgz https://musl.cc/x86_64-linux-musl-cross.tgz | |
tar xzf amd64-musl.tgz | |
make build PROJECT_NAME=dpanel-musl-amd64 CGO_ENABLED=1 \ | |
CC=${PWD}/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc \ | |
CXX=${PWD}/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++ | |
# arm64-musl | |
curl -Lo arm64-musl.tgz https://musl.cc/aarch64-linux-musl-cross.tgz | |
tar xzf arm64-musl.tgz | |
make build PROJECT_NAME=dpanel-musl-arm64 CGO_ENABLED=1 GOARM=7 GOARCH=arm64 GOOS=linux \ | |
CC=${PWD}/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc \ | |
CXX=${PWD}/aarch64-linux-musl-cross/bin/aarch64-linux-musl-g++ | |
# arm-musl | |
curl -Lo arm-musl.tgz https://musl.cc/arm-linux-musleabihf-cross.tgz | |
tar zxf arm-musl.tgz | |
make build PROJECT_NAME=dpanel-musl-arm CGO_ENABLED=1 GOARM=7 GOARCH=arm GOOS=linux \ | |
CC=${PWD}/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-gcc \ | |
CXX=${PWD}/arm-linux-musleabihf-cross/bin/arm-linux-musleabihf-g++ | |
docker buildx build \ | |
-t dpanel/dpanel:lite \ | |
-t dpanel/dpanel:${GITHUB_REF_NAME#v}-lite \ | |
-t registry.cn-hangzhou.aliyuncs.com/dpanel/dpanel:lite \ | |
-t registry.cn-hangzhou.aliyuncs.com/dpanel/dpanel:${GITHUB_REF_NAME#v}-lite \ | |
--platform linux/arm64,linux/amd64,linux/arm/v7 \ | |
--build-arg APP_VERSION=${GITHUB_REF_NAME#v} \ | |
-f Dockerfile-lite \ | |
. --push | |
docker buildx build \ | |
-t dpanel/dpanel:latest \ | |
-t dpanel/dpanel:${GITHUB_REF_NAME#v} \ | |
-t registry.cn-hangzhou.aliyuncs.com/dpanel/dpanel:latest \ | |
-t registry.cn-hangzhou.aliyuncs.com/dpanel/dpanel:${GITHUB_REF_NAME#v}-latest \ | |
--platform linux/arm64,linux/amd64,linux/arm/v7 \ | |
--build-arg APP_VERSION=${GITHUB_REF_NAME#v} \ | |
. --push | |
- name: upload artifact | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ github.ref_name }} | |
files: runtime/* | |
prerelease: false |