diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 47252fb..817697c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,7 +97,7 @@ jobs: env: cache-name: binaries with: - path: ${{ needs.setup-go.outputs.GOPATH }}/src/github.com/flannel-io/cni-plugin/dist + path: dist key: ${{ runner.os }}-binaries-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-binaries-${{ env.cache-name }} @@ -158,7 +158,7 @@ jobs: env: cache-name: tarfiles with: - path: ${{ needs.setup-go.outputs.GOPATH }}/src/github.com/flannel-io/cni-plugin/release-${{ github.ref_name }} + path: release key: ${{ runner.os }}-tarfiles-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-tarfiles-${{ env.cache-name }} @@ -169,13 +169,13 @@ jobs: id: upload-tarfiles with: name: flannel-cni-plugin-tarfiles - path: ${{ needs.setup-go.outputs.GOPATH }}/src/github.com/flannel-io/cni-plugin/release-${{ github.ref_name }}/ + path: release/ - uses: actions/upload-artifact@v2 id: upload-binaries with: name: flannel-cni-plugin-binaries - path: ${{ needs.setup-go.outputs.GOPATH }}/src/github.com/flannel-io/cni-plugin/dist/ + path: dist/ release: needs: [setup-go, build, test, package] diff --git a/.gitignore b/.gitignore index 4b8eff6..3908df2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /bin /vendor /dist +/release .idea* static-check.log .vscode/** diff --git a/scripts/package.sh b/scripts/package.sh index b174724..3382d5d 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -4,9 +4,8 @@ set -ex cd $(dirname $0)/.. source ./scripts/version.sh -mkdir -p "${GOPATH}"/src/github.com/flannel-io/cni-plugin/release-"${TAG}" -mkdir -p "${GOPATH}"/src/github.com/flannel-io/cni-plugin/dist -cd "${GOPATH}"/src/github.com/flannel-io/cni-plugin +mkdir -p release +mkdir -p dist umask 0022 # linux archives @@ -28,8 +27,8 @@ cd "${SRC_DIR}" # linux for arch in amd64 386 arm arm64 s390x mips64le ppc64le; do GOOS=${GOOS:-$("${GO}" env GOOS)} - RELEASE_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/release-"${TAG}" \ - OUTPUT_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/dist \ + RELEASE_DIR=release \ + OUTPUT_DIR=dist \ GOARCH=$arch ./scripts/check_static.sh >> static-check.log done @@ -38,12 +37,12 @@ for arch in amd64; do unset GOARCH unset GOOS echo $arch - RELEASE_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/release-"${TAG}" \ - OUTPUT_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/dist \ + RELEASE_DIR=release \ + OUTPUT_DIR=dist \ GOARCH=$arch GOOS=windows ./scripts/check_static.sh >> static-check.log done cd "${RELEASE_DIR}" for f in *.tgz; do sha1sum $f > $f.sha1; done for f in *.tgz; do sha256sum $f > $f.sha256; done -for f in *.tgz; do sha512sum $f > $f.sha512; done \ No newline at end of file +for f in *.tgz; do sha512sum $f > $f.sha512; done diff --git a/scripts/release.sh b/scripts/release.sh index 74e2f86..f901631 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -9,8 +9,8 @@ DOCKER=${DOCKER:-docker} GO=${GO:-go} GOPATH=${GOPATH:-$(go env GOPATH)} -RELEASE_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/release-"${TAG}" -OUTPUT_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/dist +RELEASE_DIR=release +OUTPUT_DIR=dist # Always clean first rm -rf "${OUTPUT_DIR}" @@ -19,11 +19,11 @@ mkdir -p "${RELEASE_DIR}" mkdir -p "${OUTPUT_DIR}" -$DOCKER run -ti -v "${SRC_DIR}":"${GOPATH}"/src/github.com/flannel-io/cni-plugin:z -e TAG="${TAG}" --rm golang:"${GOLANG_VERSION}-alpine" \ +$DOCKER run -ti -v "${SRC_DIR}":z -e TAG="${TAG}" --rm golang:"${GOLANG_VERSION}-alpine" \ /bin/sh -ex -c "\ - mkdir -p ${GOPATH}/src/github.com/flannel-io/cni-plugin/release-${TAG}; - mkdir -p ${GOPATH}/src/github.com/flannel-io/cni-plugin/dist; - cd ${GOPATH}/src/github.com/flannel-io/cni-plugin; umask 0022; + mkdir -p release; + mkdir -p dist; + umask 0022; apk --no-cache add bash tar git; \ source ./scripts/version.sh; \ chmod +x ./scripts/* ; diff --git a/scripts/version.sh b/scripts/version.sh index 07fe538..df0d1f8 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -61,8 +61,8 @@ if [ -z "${TAG}" ]; then TAG=${VERSION} fi -RELEASE_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/release-"${TAG}" -OUTPUT_DIR=${GOPATH}/src/github.com/flannel-io/cni-plugin/dist +RELEASE_DIR=release +OUTPUT_DIR=dist echo "Version: ${VERSION}" echo "Commit: ${COMMIT}"