Skip to content

Commit

Permalink
fixing ci for bumpr (also generating mac amd release asset)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Mar 16, 2022
1 parent 37934f0 commit c7b935d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
cd $PROJECT_PATH
go mod vendor
mkdir -p vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/
cp /usr/local/linux/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
./ci/test-build.sh ${{ matrix.package_type }}
- name: Archive
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -77,16 +79,29 @@ jobs:
cd $PROJECT_PATH
go mod vendor
mkdir -p vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/
go test -v -tags "static" $(go list ./... | grep -v /vendor/)
# build linux binary
cp /usr/local/linux/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
go test -mod vendor -v -tags "static" $(go list ./... | grep -v /vendor/)
. /scripts/toolchains/linux/linux-build-env.sh && go build -mod vendor -ldflags "-X main.goos=linux -X main.goarch=amd64" -o packagr-bumpr-linux-amd64 -tags "static" cmd/bumpr/bumpr.go
go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o packagr-bumpr-linux-amd64 -tags "static" cmd/bumpr/bumpr.go
# build mac binary
cp /usr/local/osx-ndk-x86/macports/pkgs/opt/local/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
. /scripts/toolchains/osx/osx-build-env.sh && go build -mod vendor -ldflags "-X main.goos=darwin -X main.goarch=amd64" -o packagr-bumpr-darwin-amd64 -tags "static" cmd/bumpr/bumpr.go
chmod +x packagr-bumpr-linux-amd64
chmod +x packagr-bumpr-darwin-amd64
./packagr-bumpr-linux-amd64 --help
echo "listing linked libraries" && ldd packagr-bumpr-linux-amd64
- name: Archive
uses: actions/upload-artifact@v2
with:
name: bumpr-binary
name: bumpr-linux-binary
path: ${{ env.PROJECT_PATH }}/packagr-bumpr-linux-amd64
- name: Archive
uses: actions/upload-artifact@v2
with:
name: bumpr-mac-binary
path: ${{ env.PROJECT_PATH }}/packagr-bumpr-darwin-amd64
7 changes: 6 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ jobs:
# build linux binary
. /scripts/toolchains/linux/linux-build-env.sh && go build -mod vendor -ldflags "-X main.goos=linux -X main.goarch=amd64" -o packagr-bumpr-linux-amd64 -tags "static" cmd/bumpr/bumpr.go
# build mac binary
cp /usr/local/osx-ndk-x86/macports/pkgs/opt/local/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
. /scripts/toolchains/osx/osx-build-env.sh && go build -mod vendor -ldflags "-X main.goos=darwin -X main.goarch=amd64" -o packagr-bumpr-darwin-amd64 -tags "static" cmd/bumpr/bumpr.go
chmod +x packagr-bumpr-linux-amd64
chmod +x packagr-bumpr-darwin-amd64
./packagr-bumpr-linux-amd64 --help
echo "listing linked libraries" && ldd packagr-bumpr-linux-amd64
Expand All @@ -63,4 +68,4 @@ jobs:
# This is necessary in order to push a commit to the repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this line unchanged
with:
upload_assets: 'packagr-bumpr-linux-amd64'
upload_assets: 'packagr-bumpr-linux-amd64 packagr-bumpr-darwin-amd64'

0 comments on commit c7b935d

Please sign in to comment.