Skip to content

fixed release (#175) #19

fixed release (#175)

fixed release (#175) #19

Workflow file for this run

name: release
on:
push:
tags:
- 'v*'
env:
PKG_TAG: ${{ github.ref_name }}
jobs:
release:
name: Release on GitHub
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
pages: write
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Setup node caches
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.cache
key: ${{ runner.os }}-yarn-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Build plugin
run: |
export PLUGIN_TAG="${PKG_TAG#v}"
yq -iP '.version=env(PLUGIN_TAG)' package.json -o json
make vl-plugin-check
- name: Prepare release notes
run: |
if grep -q "^## tip$" CHANGELOG.md; then
echo "Processing CHANGELOG"
else
echo "ERROR: Not found 'tip' section in CHANGELOG. Please add relavant entries and recreate git tag"
exit 1
fi
export NOTES="$(sed -n '/## tip/,/## /p' CHANGELOG.md | sed -e '$d' -e '1d')"
sed -i 's/## tip/&\n\n## ${{ env.PKG_TAG }}/' CHANGELOG.md
cat <<EOT > NOTES.md
$NOTES
EOT
- name: Upload release assets
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.PKG_TAG }} --notes-file=NOTES.md ./dist/*
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.VM_BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.VM_BOT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Automatic changelog update
if: ${{ hashFiles('NOTES.md') != '' }}
run: |
rm -rf NOTES.md
export CL_BRANCH="changelog-update-$(date +%s)"
git checkout -b "${CL_BRANCH}"
git add CHANGELOG.md
git commit -S -m "Automatic update CHANGELOG"
git push origin ${CL_BRANCH}
gh pr create -f
env:
GH_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"
GITHUB_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"