Skip to content

Commit

Permalink
Updated GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiolk committed May 16, 2024
1 parent a8f56ec commit e0b6644
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/create_github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on: push
permissions:
contents: write
jobs:
build:
check_version:
name: Create Github Release
runs-on: ubuntu-latest
outputs:
myOutput: ${{ steps.step1.outputs.myOutput }}
myOutput: ${{ steps.readVersion.outputs.myOutput }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -16,22 +16,25 @@ jobs:
with:
java-version: 17
- 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 "##[set-output name=versionName]$MY_VERSION"
MY_VERSION=$(grep '^versionName' gradle.properties | cut -d'=' -f2)
echo "Version name from gradle.properties: $MY_VERSION"
# echo "##[set-output name=versionName]$MY_VERSION"
# echo "::set-output name=myOutput::$MY_VERSION"
echo "VERSION_NAME=$MY_VERSION" >> "$GITHUB_OUTPUT"
shell: bash
- name: Step 1
id: step1
run: echo "::set-output name=myOutput::1.0.4"
# - name: Step 1
# id: step1
# run: echo "::set-output name=myOutput::1.0.4"
# - uses: ncipollo/release-action@v1
# with:
# tag: ${{ steps.build.outputs.versionName }}
# replacesArtifacts: true
# artifacts: build/libs/detekt-rules.jar

job2:
needs: build
needs: check_version
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -49,14 +52,19 @@ jobs:
- name: Setup gpg private key
run: |
echo "${{secrets.GPG_PRIVATE_KEY}}" > maven-secret-key.asc
- name: Get version name
env:
VERSION_NAME: ${{ needs.check_version.outputs.myOutput }}
run: echo "The selected version name is $VERSION_NAME"
- name: Step 2
run: echo "Output from Job 1 ${{ needs.build.outputs.myOutput }}"
run: echo "Output from Job 1 ${{ needs.check_version.outputs.myOutput }}"
- name: Generate jar
run: |
./gradlew jar
echo $versionName
echo ${{ needs.check_version.outputs.myOutput }}
- uses: ncipollo/release-action@v1
with:
tag: ${{ needs.build.outputs.myOutput }}
tag: ${{ needs.check_version.outputs.myOutput }}
replacesArtifacts: true
artifacts: build/libs/detekt-rules.jar
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ allprojects {
apply(plugin = "signing")

val dokkaHtml by tasks.existing(DokkaTask::class)

val dokkaJar by tasks.creating(org.gradle.jvm.tasks.Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
archiveClassifier.set("javadoc")
Expand Down

0 comments on commit e0b6644

Please sign in to comment.