Skip to content

Commit

Permalink
Fix GOROOT and GOPATH when building package
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien Blaisot committed Oct 16, 2023
1 parent 8617af9 commit 0214978
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ jobs:
- name: Build the binaries
run: |
GOOS=linux GOARCH=amd64 ./scripts/build.sh release
GOOS=linux GOARCH=arm ./scripts/build.sh release
GOOS=freebsd GOARCH=amd64 ./scripts/build.sh release
# GOOS=linux GOARCH=arm ./scripts/build.sh release
# GOOS=freebsd GOARCH=amd64 ./scripts/build.sh release
- name: Create the release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${GITHUB_REF##*/}"
gh release create "$tag_name" cozy-stack-* --target "$GITHUB_SHA"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_SECRET }}
- name: Build and publish the cozy-app-dev image
run: scripts/release.sh
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_SECRET }}
# - name: Build and publish the cozy-app-dev image
# run: scripts/release.sh
build_deb_packages:
strategy:
matrix:
Expand Down
6 changes: 3 additions & 3 deletions scripts/packaging/buildpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ if command -v go > /dev/null; then
eval "$(go env)"
export GOROOT GOPATH
else
export GOROOT="${GOROOT:-/tmp/go}"
export GOPATH="${GOPATH:-/tmp/goroot}"
export PATH="${GOPATH}/bin:$GOROOT/bin:${PATH}"
export GOROOT="${GOROOT:-/tmp/goroot}"
export GOPATH="${GOPATH:-/tmp/go}"
export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
fi

cd "$(dirname $0)/../.."
Expand Down
5 changes: 3 additions & 2 deletions scripts/packaging/installrequirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ if [ -z "${SKIP_GO:-}" ]; then
echo "Install GO"
echo "=========="
export GOROOT="${GOROOT:-/tmp/goroot}"
[ ! -d "/tmp/goroot" ] && mkdir -p "/tmp/goroot"
[ ! -d "${GOROOT}" ] && mkdir -p "${GOROOT}"
export GOPATH="${GOPATH:-/tmp/go}"
[ ! -d "${GOPATH}" ] && mkdir -p "${GOPATH}"
if [ ! -x "${GOROOT}/bin/go" ]; then
echo ". download go archive"
[ -f "go.tar.gz" ] || wget --quiet https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz -O /tmp/go.tar.gz
Expand All @@ -32,5 +33,5 @@ if [ -z "${SKIP_GO:-}" ]; then
tar xf /tmp/go.tar.gz -C "${GOROOT}" --strip-components=1
rm -rf /tmp/go.tar.gz
fi
export PATH="${GOPATH}/bin:$GOROOT/bin:${PATH}"
export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
fi

0 comments on commit 0214978

Please sign in to comment.