From c7983bd7f4196c39948923b4ba50bd7398783f49 Mon Sep 17 00:00:00 2001 From: noface Date: Wed, 15 Nov 2023 09:23:58 +0100 Subject: [PATCH] publish package on master --- .github/workflows/gopackagespub.yml | 46 +++++++++++++++++++++++++++++ release/release.sh | 10 +++---- 2 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/gopackagespub.yml diff --git a/.github/workflows/gopackagespub.yml b/.github/workflows/gopackagespub.yml new file mode 100644 index 0000000000..9f208ec5b5 --- /dev/null +++ b/.github/workflows/gopackagespub.yml @@ -0,0 +1,46 @@ +name: Build master and publish binaries +on: + push: + branches: + - master + +env: + # go needs absolute directories, using the $HOME variable doesn't work here. + GOCACHE: /home/runner/work/go/pkg/build + GOPATH: /home/runner/work/go + GO_VERSION: 1.21.4 + +jobs: + build: + name: Build master + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Check out source + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Detect env + id: detect + shell: bash + run: echo "sha8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_OUTPUT + + - name: Build once + run: make build + + - name: Build + run: ./release/release.sh ${{ steps.detect.outputs.sha8 }} + + - name: Publish + uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 + with: + repo_token: ${{ github.token }} + automatic_release_tag: master-release + prerelease: true + title: "Development build: master" + files: ppcd-${{ steps.detect.outputs.sha8 }}/* diff --git a/release/release.sh b/release/release.sh index 366eee2905..c7ff23cc68 100755 --- a/release/release.sh +++ b/release/release.sh @@ -19,16 +19,16 @@ else TAG=$1 fi -go mod vendor -tar -cvzf vendor.tar.gz vendor +# go mod vendor +# tar -cvzf vendor.tar.gz vendor PACKAGE=ppcd MAINDIR=$PACKAGE-$TAG mkdir -p $MAINDIR -cp vendor.tar.gz $MAINDIR/ -rm vendor.tar.gz -rm -r vendor +# cp vendor.tar.gz $MAINDIR/ +# rm vendor.tar.gz +# rm -r vendor PACKAGESRC="$MAINDIR/$PACKAGE-source-$TAG.tar" git archive -o $PACKAGESRC HEAD