Skip to content

Commit

Permalink
chore(release): Fix publish credentials (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseLion authored Sep 17, 2023
1 parent 5b2dcf8 commit 8d6c8d6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 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/owner-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Auto approve for owner

on:
pull_request_target:
pull_request:
types: [opened, reopened]

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,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 @@ -146,6 +146,20 @@ gradlePlugin {
testSourceSets.add(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 8d6c8d6

Please sign in to comment.