Skip to content

Create Draft Release #23

Create Draft Release

Create Draft Release #23

name: Create Draft Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version (example: 4.8.2)'
required: true
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
version: ${{ steps.collect-data.outputs.version }}
steps:
- name: Collect Data
id: collect-data
uses: actions/github-script@v4
with:
script: |
core.setOutput("version", context.payload.inputs.version);
- run: |
echo "Creating version ${{ steps.collect-data.outputs.version }}"
draft-release:
needs: [ setup ]
name: Draft Release ${{ needs.setup.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK for GPG
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
gpg-private-key: ${{ secrets.GPG_SECRET }}
gpg-passphrase: GPG_PASSPHRASE
env:
GPG_PASSWORD: ${{ secrets.GPG_PASSPHRASE }}
- name: Create Artifacts
env:
GPG_PASSWORD: ${{ secrets.GPG_PASSPHRASE }}
run: |
mvn -B versions:set -DnewVersion=${{ needs.setup.outputs.version }}
mvn -B package
## Extract pom
(cd target && unzip -j liquibase-sdk-maven-plugin-${{ needs.setup.outputs.version }}.jar META-INF/maven/org.liquibase.ext/liquibase-sdk-maven-plugin/pom.xml)
mv target/pom.xml target/liquibase-sdk-maven-plugin-${{ needs.setup.outputs.version }}.pom.xml
## Sign files
(cd target && gpg --batch --pinentry-mode=loopback --passphrase "$GPG_PASSWORD" -ab liquibase-sdk-maven-plugin-${{ needs.setup.outputs.version }}.jar)
(cd target && gpg --batch --pinentry-mode=loopback --passphrase "$GPG_PASSWORD" -ab liquibase-sdk-maven-plugin-${{ needs.setup.outputs.version }}-javadoc.jar)
(cd target && gpg --batch --pinentry-mode=loopback --passphrase "$GPG_PASSWORD" -ab liquibase-sdk-maven-plugin-${{ needs.setup.outputs.version }}-sources.jar)
(cd target && gpg --batch --pinentry-mode=loopback --passphrase "$GPG_PASSWORD" -ab liquibase-sdk-maven-plugin-${{ needs.setup.outputs.version }}.pom.xml)
- name: Tag repository
run: |
git tag -f v${{ needs.setup.outputs.version }}
git push -f origin v${{ needs.setup.outputs.version }}
- name: Create Draft Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ needs.setup.outputs.version }}
draft: true
fail_on_unmatched_files: true
body: Liquibase SDK Maven Plugin ${{ needs.setup.outputs.version }}
generate_release_notes: true
files: |
target/*.jar
target/*.pom.xml
target/*.asc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}