Skip to content

fix(action): fix github action #27

fix(action): fix github action

fix(action): fix github action #27

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
TZ: Asia/Shanghai
GO_VERSION: '1.20'
permissions: write-all
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: install task
run: |
echo "install task"
go install github.com/go-task/task/v3/cmd/task@latest
- name: install upx
uses: crazy-max/ghaction-upx@v2
with:
install-only: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish .deb & .rpm to Gemfury
env:
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
run: |
for filename in dist/*.deb; do
echo "Pushing $filename to apt repository"
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/ysicing/
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/ysicing/
done
for filename in dist/*.rpm; do
echo "Pushing $filename to rpm repository"
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/ysicing/
curl -F package=@$filename https://${FURY_TOKEN}@push.fury.io/ysicing/
done
- name: "Upload checksums.txt"
uses: actions/upload-artifact@v3
with: { name: checksums.txt, path: dist/checksums.txt }
Changelog:
name: "Changelog"
needs: release
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: install task
run: |
echo "install task"
go install github.com/go-task/task/v3/cmd/task@latest
- name: "download checksums.txt"
uses: actions/download-artifact@v3
with: { name: checksums.txt, path: dist }
- name: fetch current version
id: get-current-tag
uses: actions-ecosystem/[email protected]
- run: ./hack/scripts/gentap.sh ${{steps.get-current-tag.outputs.tag}}
- name: Build docs
run: |
task godoc
- name: Publish docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./docs
- run: git fetch --prune --prune-tags
- run: git tag -l 'v*'
- run: ./hack/scripts/changelog.sh > CHANGELOG.md
- uses: peter-evans/create-pull-request@v5
id: cpr
with:
title: 'docs: updated CHANGELOG.md & docs for ${{steps.get-current-tag.outputs.tag}}'
commit-message: |
docs: updated CHANGELOG.md & docs
🤖 add release changelog using rebot.
branch: create-pull-request/changelog-${{steps.get-current-tag.outputs.tag}}
signoff: true
delete-branch: true
# assignees: ysicing
# reviewers: ysicing
labels: |
kind/doc
kind/bot
- name: Pull Request Automerge
if: steps.cpr.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: rebase