Skip to content

Commit

Permalink
Updated pipeline to create Github release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiolk committed May 15, 2024
1 parent 4220272 commit a8f56ec
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
43 changes: 27 additions & 16 deletions .github/workflows/create_github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 17
- 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
echo $versionName
- name: Read file and store value in variable
run: |
MY_VERSION=$(grep '^versionName' gradle.properties | cut -d'=' -f2)
Expand All @@ -36,16 +23,40 @@ jobs:
shell: bash
- name: Step 1
id: step1
run: echo "::set-output name=myOutput::Hello from Job 1"
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: job1
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- 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: Step 2
run: echo "Output from Job 1 ${{ needs.build.outputs.myOutput }}"
run: echo "Output from Job 1 ${{ needs.build.outputs.myOutput }}"
- name: Generate jar
run: |
./gradlew jar
echo $versionName
- uses: ncipollo/release-action@v1
with:
tag: ${{ needs.build.outputs.myOutput }}
replacesArtifacts: true
artifacts: build/libs/detekt-rules.jar
8 changes: 7 additions & 1 deletion .github/workflows/publish_to_maven_central.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Publish to Maven Central Repository
on: push
on:
workflow_dispatch:
pull_request:
branches:
- 'master'
- 'release/**'
- 'dev'
jobs:
build:
name: Publish to Maven Central Repository
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Code checks on Pull Request
on:
push:
branches:
- 'main'
- 'dev'
workflow_dispatch:
pull_request:
branches:
Expand Down

0 comments on commit a8f56ec

Please sign in to comment.