Skip to content

Commit

Permalink
Fixed release artifacts path
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Bonafiglia <[email protected]>
  • Loading branch information
rbrtbnfgl committed Jul 21, 2023
1 parent bff4cf9 commit 6464faa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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 }}
Expand All @@ -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]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/bin
/vendor
/dist
/release
.idea*
static-check.log
.vscode/**
15 changes: 7 additions & 8 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
for f in *.tgz; do sha512sum $f > $f.sha512; done
12 changes: 6 additions & 6 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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/* ;
Expand Down
4 changes: 2 additions & 2 deletions scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 6464faa

Please sign in to comment.