Release #44
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions Workflow created for handling the release process based on the release prepared | |
# with the Build workflow. Running the publishPlugin task requires the PUBLISH_TOKEN secret provided. | |
name: Release | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
# Prepare and publish the plugin to the Marketplace repository | |
release: | |
name: Publish Plugin | |
runs-on: ubuntu-latest | |
steps: | |
# Check out current repository | |
- name: Fetch Sources | |
uses: actions/[email protected] | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
# Setup Java 17 environment for the next steps | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: corretto | |
java-version: 17 | |
cache: gradle | |
# Insert Analytics secrets | |
- name: Applying Analytics Secrets | |
run: | | |
echo "analytics_api_secrets=${{ secrets.ANALYTICS_API_SECRETS }}" > src/main/resources/messages/secrets.properties | |
echo "analytics_measurement_id=${{ secrets.ANALYTICS_MEASUREMENT_ID }}" >> src/main/resources/messages/secrets.properties | |
# Output changelog from release body | |
- name: Export Properties | |
id: properties | |
shell: bash | |
run: | | |
CHANGELOG="$(cat << 'EOM' | |
${{ github.event.release.body }} | |
EOM | |
)" | |
CHANGELOG="${CHANGELOG//'%'/'%25'}" | |
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | |
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" | |
echo "::set-output name=changelog::$CHANGELOG" | |
# Publish the plugin to the Marketplace | |
- name: Publish Plugin | |
env: | |
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} | |
run: ./gradlew publishPlugin | |
# Upload artifact as a release asset | |
- name: Upload Release Asset | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: gh release upload ${{ github.event.release.tag_name }} ./build/distributions/* | |
# fixme: disabled changelog update as changelog gradle plugin removes random versions in the process | |
# Push changelog update | |
# - name: Push changelog update | |
# if: ${{ steps.properties.outputs.changelog != ''}} | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# run: | | |
# VERSION="${{ github.event.release.tag_name }}" | |
# | |
# git config user.email "[email protected]" | |
# git config user.name "GitHub Action" | |
# | |
# git fetch | |
# git checkout main | |
# git add CHANGELOG.md | |
# | |
# git commit -am "📝: patch CHANGELOG.md for $VERSION [skip ci]" | |
# git push origin main |