1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-04 19:17:37 +08:00

upload dist

This commit is contained in:
wdvxdr 2021-03-27 11:02:30 +08:00
parent 2b3842e61c
commit 76d00a57ff
No known key found for this signature in database
GPG Key ID: 55FF1414A69CEBA6
3 changed files with 36 additions and 4 deletions

View File

@ -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

View File

@ -16,6 +16,8 @@ builds:
- amd64
- arm
- arm64
goarm:
- 7
ignore:
- goos: darwin
goarch: arm

19
scripts/upload_dist.sh Normal file
View File

@ -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