-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHA Snapshot publishing #912
Open
aSemy
wants to merge
6
commits into
mockk:master
Choose a base branch
from
aSemy:feat/gha_snapshot_publishing
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cfb64d1
initial implementation of GHA Snapshot publishing
aSemy 8e10f3c
remove period from Gradle signing properties
aSemy e5b377d
adjust comment
aSemy cf5f76f
update workflow to use official Gradle GHA
aSemy 66605f3
disable parallel publishing (Sonatype doesn't like it)
aSemy 4853205
rename step to match command
aSemy File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Publishing | ||
|
||
on: | ||
# Only publish when 'All tests' has finished on master branch | ||
workflow_run: | ||
workflows: [ All tests ] | ||
branches: [ master ] | ||
types: [ completed ] | ||
|
||
# This allows a subsequently queued workflow run to interrupt previous runs | ||
concurrency: | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish_snapshot: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} # only publish if the tests passed | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: adopt | ||
java-version: 11 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Publish snapshot to Sonatype | ||
env: | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GRADLE_SIGNING_KEY_ID }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GRADLE_SIGNING_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingSecretKeyRingFile: ${{ secrets.GRADLE_SIGNING_SECRET_KEY_RING_FILE }} | ||
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSS_SONATYPE_USERNAME }} | ||
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSS_SONATYPE_PASSWORD }} | ||
run: ./gradlew publishToSonatypeStaging --no-parallel | ||
# don't run in parallel - Sonatype doesn't like it |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check this guide https://central.sonatype.org/publish/publish-gradle/.
I have doubts that this is right URL.
I will try to deal with required secrets and set them in GH settings:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @oleksiyp!
Would you consider granting @Raibaz co-ownership? Then he could also manage the secrets.
MockK was published before 2021 so still uses the 'legacy host', but the docs mostly use the new URLs.
The current MockK config uses the same URL and it works okay
mockk/buildSrc/src/main/kotlin/buildsrc/convention/mockk-publishing.gradle.kts
Lines 15 to 21 in 1419517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure you will need other secrets... and not sure you need them for something else... security is always compromise of comfort. So no 😄 but remember that I am still alive and happy to help 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afterall if @Raibaz feels that more access is required happy to understand the reasoning and cooperate.
There is a bigger issue where to spend $4k on https://opencollective.com/mockk. Previously I thought it was too small an amount to spend paying contributors... but now it is not that obvious
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm perfectly fine with the access I have now, I don't think I need more :)
After all, this should be a one-shot operation and we should be ok with secrets now, I don't think I'll need access to change them anytime soon.