Skip to content

Gradle release workflow #4

Gradle release workflow

Gradle release workflow #4

Workflow file for this run

name: Gradle release workflow
on:
workflow_dispatch:
jobs:
build_and_package:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Download code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle Wrapper
run: ./gradlew build
- name: Copy plugin jars
run: mkdir staging && cp build/libs/*.jar staging
- name: Build plugin artifacts zip
run: |
zip --junk-paths plugin-artifacts staging/*
- name: Upload plugin artifacts
uses: actions/upload-artifact@v3
with:
name: plugin-artifacts.zip
path: plugin-artifacts.zip
create_release:
runs-on: ubuntu-latest
needs: build_and_package
permissions: write-all
steps:
# - name: Download code
# uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Configure committer
run: |
git config user.name pjoshi2023
git config user.email [email protected]
- name: Bump version
uses: qzb/[email protected]
# - name: Conventional changelog action
# id: changelog
# uses: TriPSs/conventional-changelog-action@v5
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# skip-tag: "true"
- name: Fetch release version from build gradle file
run: |
echo "RELEASE_VERSION=$(./gradlew printProperties | grep version | awk '{print $2}')" >> $GITHUB_ENV
# - name: Create git tag
# run: |
# export version=$(./gradlew printProperties | grep version | awk '{print $2}')
# echo 'Today is ${{ env.RELEASE_VERSION }}'
# git config user.name pjoshi2023
# git config user.email [email protected]
# git tag -a $version -m "$version"
# git push origin $version
# - name: Download plugin artifacts
# uses: actions/download-artifact@v2
# with:
# name: plugin-artifacts.zip
# - name: Create release
# id: create_release
# uses: actions/create-release@v1
# if: ${{ steps.changelog.outputs.skipped == 'false' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ env.RELEASE_VERSION }}
# release_name: ${{ env.RELEASE_VERSION }}
# body: ${{ steps.changelog.outputs.clean_changelog }}
# draft: false
# prerelease: false
# - name: Upload release asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./plugin-artifacts.zip
# asset_name: plugin-artifacts.zip
# asset_content_type: application/zip