From 76d00a57ff3f42a3e7474f7e93675949437477a6 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Sat, 27 Mar 2021 11:02:30 +0800 Subject: [PATCH] upload dist --- .github/workflows/release.yml | 19 +++++++++++++++---- .goreleaser.yml | 2 ++ scripts/upload_dist.sh | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 scripts/upload_dist.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 53f2e2b..54b6473 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,14 +9,12 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v2.3.4 with: fetch-depth: 0 - - - name: Set up Go + - name: Set up Go uses: actions/setup-go@v2 with: go-version: '1.16.2' @@ -28,3 +26,16 @@ jobs: args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout Dist + uses: actions/checkout@v2 + with: + repository: 'gocq/dist' + ref: master + ssh-key: ${{ secrets.SSH_KEY }} + path: upstream/dist + + - name: Update Dist + run: | + chmod +x scripts/upload_dist.sh + ./scripts/upload_dist.sh diff --git a/.goreleaser.yml b/.goreleaser.yml index e9a9a5a..af89e8c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -16,6 +16,8 @@ builds: - amd64 - arm - arm64 + goarm: + - 7 ignore: - goos: darwin goarch: arm diff --git a/scripts/upload_dist.sh b/scripts/upload_dist.sh new file mode 100644 index 0000000..0d864f2 --- /dev/null +++ b/scripts/upload_dist.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ "$GITHUB_ACTIONS" != "true" ]; then + echo "This script is only meant to be run in GitHub Actions." + exit 1 +fi + +cp -f dist/*.tar.gz upstream/dist/downloads +cp -f dist/*.zip upstream/dist/downloads +cd upstream/dist || exit +LATEST_VERSION="${GITHUB_REF#"refs/tags/"}" +git config --local user.name 'Github Actions' +git config --local user.email 'github-actions@users.noreply.github.com' +git add --all +git commit -m "update to $LATEST_VERSION" +git tag -d "${GITHUB_REF#"refs/tags/"}" +git tag "${GITHUB_REF#"refs/tags/"}" +git push +git push --tags \ No newline at end of file