release #11
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 | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "v0.*" | |
jobs: | |
Build: | |
name: build-binary | |
runs-on: ubuntu-latest | |
env: | |
TZ: Asia/Shanghai | |
steps: | |
- name: Hello world | |
run: uname -a | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
cache: 'yarn' | |
cache-dependency-path: 'web/yarn.lock' | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
cache-dependency-path: 'server/go.sum' | |
- name: Build web | |
working-directory: web | |
run: | | |
yarn install | |
yarn run build | |
- name: Set up QEMU | |
# https://github.com/docker/setup-qemu-action | |
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: bjdgyc | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
logout: true | |
- name: pre bash | |
shell: bash | |
run: | | |
appVer=`cat version` | |
commitId=`git rev-parse HEAD` | |
echo "APP_VER=$appVer" >> $GITHUB_ENV | |
echo "commitId=$commitId" >> $GITHUB_ENV | |
cd server;go mod tidy | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
push: false | |
context: . | |
file: ./docker/Dockerfile | |
#platforms: linux/amd64,linux/arm64 | |
platforms: linux/amd64 | |
build-args: appVer=${{ env.APP_VER }} commitId=${{ env.commitId }} | |
#tags: bjdgyc/anylink:latest,bjdgyc/anylink:${{ env.APP_VER }} | |
tags: bjdgyc/anylink:${{ env.APP_VER }} | |
# - name: Docker Build binary | |
# shell: bash | |
# run: | | |
# #sudo apt-get install -y -q gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | |
# bash release.sh | |
# Docker: | |
# name: build-docker |