Merge pull request #4 from Kiolk/dev #29
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
name: Create Github Release | |
on: | |
push: | |
branches: | |
- 'master' | |
permissions: | |
contents: write | |
jobs: | |
check_version: | |
name: Read release version | |
runs-on: ubuntu-latest | |
outputs: | |
versionName: ${{ steps.readVersion.outputs.VERSION_NAME }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Read file and store value in variable | |
id: readVersion | |
run: | | |
MY_VERSION=$(grep '^versionName' gradle.properties | cut -d'=' -f2) | |
echo "Version name from gradle.properties: $MY_VERSION" | |
echo "VERSION_NAME=$MY_VERSION" >> "$GITHUB_OUTPUT" | |
shell: bash | |
generate_release: | |
name: Generate Github release | |
needs: check_version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: 'zulu' | |
- name: Setup variables in local.properties | |
run: | | |
echo "signing_keyId=${{secrets.SIGNING_KEY_ID}}" > local.properties | |
echo "signing_password=${{secrets.SIGNING_PASSWORD}}" >> local.properties | |
echo "username=${{secrets.MAVEN_CENTRAL_USER_NAME}}" >> local.properties | |
echo "password=${{secrets.MAVEN_CENTRAL_PASSWORD}}" >> local.properties | |
- name: Setup gpg private key | |
run: | | |
echo "${{secrets.GPG_PRIVATE_KEY}}" > maven-secret-key.asc | |
- name: Generate jar | |
run: | | |
./gradlew jar | |
- uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ needs.check_version.outputs.versionName }} | |
replacesArtifacts: true | |
artifacts: build/libs/detekt-rules.jar | |
skipIfReleaseExists: true | |
generateReleaseNotes: true |