Fix: Release GIT AUTH TOKEN missing error fixed (#1030)

This commit is contained in:
ybyang
2022-05-18 01:47:19 +08:00
committed by GitHub
parent eae61dcd00
commit 02061ea60d
4 changed files with 32 additions and 10 deletions
+13 -5
View File
@@ -47,19 +47,27 @@ jobs:
push: false
load: true
tags: sealos:latest
build-args: ACTION=build-release
build-args: |
ACTION=build-release
GITHUB_TOKEN=${{ secrets.GIT_AUTH_TOKEN }}
secrets: GITHUB_TOKEN=${{ secrets.GIT_AUTH_TOKEN }}
# https://github.com/docker/build-push-action
- name: Copy Out Binarys
run: |
docker run -itd --name sealos --rm sealos:latest bash
docker cp sealos:/work/dist .
- name: Build binareies to oss
env:
BUCKETNAME: ${{ secrets.BUCKETNAME }}
run: |
echo ${{ secrets.OSS_CONFIG }} |base64 --decode >> .ossutilconfig
wget http://gosspublic.alicdn.com/ossutil/1.6.19/ossutil64 && chmod 755 ossutil64
./ossutil64 -c .ossutilconfig cp -f dist/sealos_linux_amd64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/${{ steps.prepare.outputs.tag_name }}/sealos-amd64
./ossutil64 -c .ossutilconfig cp -f dist/sealos_linux_arm64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/${{ steps.prepare.outputs.tag_name }}/sealos-arm64
./ossutil64 -c .ossutilconfig cp -f dist/sealos_linux_amd64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/latest/sealos-amd64
./ossutil64 -c .ossutilconfig cp -f dist/sealos_linux_arm64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/latest/sealos-arm64
./ossutil64 -c .ossutilconfig cp -f dist/sealos-amd64_linux_amd64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/${{ steps.prepare.outputs.tag_name }}/sealos-amd64
./ossutil64 -c .ossutilconfig cp -f dist/sealos-arm64_linux_arm64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/${{ steps.prepare.outputs.tag_name }}/sealos-arm64
./ossutil64 -c .ossutilconfig cp -f dist/sealos-amd64_linux_amd64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/latest/sealos-amd64
./ossutil64 -c .ossutilconfig cp -f dist/sealos-arm64_linux_arm64/sealos oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/latest/sealos-arm64
./ossutil64 -c .ossutilconfig cp -f dist/sealctl_linux_amd64/sealctl oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/${{ steps.prepare.outputs.tag_name }}/sealctl-amd64
./ossutil64 -c .ossutilconfig cp -f dist/sealctl_linux_arm64/sealctl oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/${{ steps.prepare.outputs.tag_name }}/sealctl-arm64
./ossutil64 -c .ossutilconfig cp -f dist/sealctl_linux_amd64/sealctl oss://${BUCKETNAME:-sealyun-home}/sealos-4.0/latest/sealctl-amd64
+4
View File
@@ -65,6 +65,9 @@ builds:
binary: sealctl
goos:
- linux
goarch:
- arm64
- amd64
ldflags:
- -X github.com/labring/sealos/pkg/version.gitVersion={{.Version}}
- -X github.com/labring/sealos/pkg/version.gitCommit={{.ShortCommit}}
@@ -78,6 +81,7 @@ builds:
# amd64: x86_64
# arm64: aarch64
checksum:
disable: true
name_template: '{{ .ProjectName }}_checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
+1 -1
View File
@@ -14,7 +14,7 @@
FROM --platform=$BUILDPLATFORM golang:1.17-buster as builder
ENV GOPROXY=https://goproxy.cn
ARG GITHUB_TOKEN=$GITHUB_TOKEN
ARG TARGETARCH
ARG ACTION=build-pack
+14 -4
View File
@@ -1,16 +1,26 @@
Dirs=$(shell ls)
COMMIT_ID ?= $(shell git rev-parse --short HEAD || echo "0.0.0")
BUILD_TIME=$(shell date +%FT%T%z)
GIT_TAG := $(shell git describe --exact-match --tags --abbrev=0 2> /dev/null || echo untagged)
LDFLAGS=-ldflags
# only support linux
OS=linux
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CGO_ENABLED=0
OS=darwin
endif
ifeq ($(UNAME_S),Linux)
CGO_ENABLED=1
endif
override LDFLAGS += "\
-X github.com/labring/sealos/pkg/version.gitVersion=${GIT_TAG} \
-X github.com/labring/sealos/pkg/version.gitCommit==${COMMIT_ID} \
-X github.com/labring/sealos/pkg/version.buildDate=${BUILD_TIME} "
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifneq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
@@ -48,12 +58,12 @@ default: build
build: build-amd64 build-arm64
build-amd64:
CGO_ENABLED=${CGO_ENABLED} GOOS=${OS} GOARCH=amd64 go build -o $(shell pwd)/bin/${OS}_amd64/sealos -tags "containers_image_openpgp" cmd/sealos/main.go
CGO_ENABLED=0 GOOS=${OS} GOARCH=amd64 go build -o $(shell pwd)/bin/${OS}_amd64/seactl -tags "containers_image_openpgp" cmd/sealctl/main.go
CGO_ENABLED=${CGO_ENABLED} GOOS=${OS} GOARCH=amd64 go build ${LDFLAGS} -o $(shell pwd)/bin/${OS}_amd64/sealos -tags "containers_image_openpgp" cmd/sealos/main.go
CGO_ENABLED=0 GOOS=${OS} GOARCH=amd64 go build ${LDFLAGS} -o $(shell pwd)/bin/${OS}_amd64/seactl -tags "containers_image_openpgp" cmd/sealctl/main.go
build-arm64:
CGO_ENABLED=${CGO_ENABLED} GOOS=${OS} GOARCH=arm64 go build -o $(shell pwd)/bin/${OS}_arm64/sealos -tags "containers_image_openpgp" cmd/sealos/main.go
CGO_ENABLED=0 GOOS=${OS} GOARCH=arm64 go build -o $(shell pwd)/bin/${OS}_arm64/seactl -tags "containers_image_openpgp" cmd/sealctl/main.go
CGO_ENABLED=${CGO_ENABLED} GOOS=${OS} GOARCH=arm64 go build ${LDFLAGS} -o $(shell pwd)/bin/${OS}_arm64/sealos -tags "containers_image_openpgp" cmd/sealos/main.go
CGO_ENABLED=0 GOOS=${OS} GOARCH=arm64 go build ${LDFLAGS} -o $(shell pwd)/bin/${OS}_arm64/seactl -tags "containers_image_openpgp" cmd/sealctl/main.go
import:
goimports -l -w cmd