Skip to content

Commit

Permalink
chore(release): Fix publish credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseLion committed Sep 18, 2023
1 parent 2a92fba commit 54f2213
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: oracle
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/configure-pages@v3
- uses: actions/jekyll-build-pages@v1
with:
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: oracle
Expand All @@ -34,15 +34,13 @@ jobs:
with:
node-version-file: .nvmrc
cache: yarn
- name: Provision
run: |
sed -i "s/{GRADLE_PUBLISH_KEY}/${{ secrets.GRADLE_PUBLISH_KEY }}/g" gradle.properties
sed -i "s/{GRADLE_PUBLISH_SECRET}/${{ secrets.GRADLE_PUBLISH_SECRET }}/g" gradle.properties
- run: ./gradlew build
- run: yarn install --immutable
- run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_gradlePublishKey: ${{ secrets.GRADLE_PUBLISH_KEY }}
ORG_GRADLE_PROJECT_gradlePublishSecret: ${{ secrets.GRADLE_PUBLISH_SECRET }}

pages:
uses: ./.github/workflows/pages.yml
Expand Down
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,20 @@ gradlePlugin {
testSourceSets(sourceSets.testkit)
}

task preparePublish() {
doLast {
def publishKey = findProperty('gradlePublishKey')
def publishSecret = findProperty('gradlePublishSecret')

System.properties.setProperty('gradle.publish.key', publishKey)
System.properties.setProperty('gradle.publish.secret', publishSecret)
}
}

tasks.named('check') {
dependsOn(testing.suites.testkit)
}

tasks.named('publishPlugins') {
dependsOn(tasks.preparePublish)
}
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
version=0.0.0

gradle.publish.key={GRADLE_PUBLISH_KEY}
gradle.publish.secret={GRADLE_PUBLISH_SECRET}

org.gradle.parallel=true
org.gradle.caching=true

0 comments on commit 54f2213

Please sign in to comment.