Skip to content

Create release

Create release #20

Workflow file for this run

name: Build signed plugin
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
outputs:
version: ${{ steps.properties.outputs.artifactName }}
steps:
- uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup properties
id: properties
shell: bash
run: |
NAME=$(grep "^pluginName=" plugin.properties | cut -d '=' -f 2)
VERSION=$(grep "^version=" plugin.properties | cut -d '=' -f 2)
echo "NAME=$NAME"
echo "VERSION=$VERSION"
echo "name=$NAME" >> $GITHUB_ENV
echo "version=$VERSION" >> $GITHUB_ENV
echo "artifactName=$NAME-$VERSION" >> $GITHUB_ENV
- name: Build signed plugin
run: ./gradlew signPlugin
- name: Remove old drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
- name: Create draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ env.artifactName }} \
--draft \
--title "${{ env.artifactName }}" \
--notes ""
- name: Upload release asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ env.artifactName }} ./plugin/build/distributions/*-signed.zip