Skip to content
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

Publish snapshot #29

Merged
merged 2 commits into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
- uses: gradle/gradle-build-action@v2
with:
arguments: build
# checks integrity of release tasks, update publish workflows too if does not work
- uses: gradle/gradle-build-action@v2
with:
arguments: |
publishAppyxReleasePublicationToOSSRHRepository
publishAppyxReleasePublicationToSonatypeSnapshotRepository
--dry-run
--no-parallel

check-documentation:
name: Check documentation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
with:
arguments: |
publish
publishAppyxReleasePublicationToOSSRHRepository
--no-parallel
-Psigning.password=${{ secrets.SIGNING_PASSWORD }}
-Psonatype.username=${{ secrets.SONATYPE_USERNAME }}
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish snapshot

on:
push:
branches:
- main
workflow_dispatch:

jobs:
publish-snapshot:
name: Publish snapshot
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/gradle-build-action@v2
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
with:
arguments: |
publishAppyxReleasePublicationToSonatypeSnapshotRepository
-Psnapshot=true
--no-parallel
-Psigning.password=${{ secrets.SIGNING_PASSWORD }}
-Psonatype.username=${{ secrets.SONATYPE_USERNAME }}
-Psonatype.password=${{ secrets.SONATYPE_PASSWORD }}
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
- Migrate [app-tree-utils](https://github.com/badoo/app-tree-utils) into this repository.
- Do not allow setting `Node.integrationPoint` on non-root nodes.
- #20 Fix integration point attached twice crash when using live literals
- Fix transition interruptions bug
- #14 Fix transition interruptions bug
- #23 Add unit test support
- #26 Publish snapshot versions

## 1.0-alpha01

Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Should be used in case if there are issues with automatic publication.
1. Create PR with following changes:
1. Update version in `gradle/publication.gradle`.
2. Create a new section with version name taking all changes from pending section.
2. `./gradle publish --no-parallel -Psigning.keyId=$KEY_ID -Psigning.password=$PASS -Psigning.secretKeyRingFile=$FILE -Psonatype.username=$NAME -Psonatype.password=$PASS`
2. `./gradle publishAppyxReleasePublicationToOSSRHRepository --no-parallel -Psigning.keyId=$KEY_ID -Psigning.password=$PASS -Psigning.secretKeyRingFile=$FILE -Psonatype.username=$NAME -Psonatype.password=$PASS`
1. `signing` properties are related to signing information.
2. `sonatype` properties are your username and password from `oss.sonatype.org`.
3. `--no-parallel` is required to avoid creation of multiple staging repositories.
Expand Down
14 changes: 14 additions & 0 deletions documentation/setup/downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,17 @@ dependencies {

}
```

## Snapshot

Snapshot version is available for all modules, use the provided repository url and `main-SNAPSHOT` version.

```groovy
repositories {
maven { url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
}

dependencies {
implementation "com.bumble.appyx:core:main-SNAPSHOT"
}
```
16 changes: 15 additions & 1 deletion gradle/publication.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ afterEvaluate { Project project ->
appyxRelease(MavenPublication) {
from components.release
groupId = 'com.bumble.appyx'
version = '1.0-alpha01'
version = project.findProperty('snapshot') == 'true' ? 'main-SNAPSHOT' : '1.0-alpha01'

pom {
name = 'Appyx'
Expand Down Expand Up @@ -52,6 +52,14 @@ afterEvaluate { Project project ->
password = project.findProperty('sonatype.password').toString()
}
}
maven {
name = 'SonatypeSnapshot'
url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
credentials {
username = project.findProperty('sonatype.username').toString()
password = project.findProperty('sonatype.password').toString()
}
}
}
}
signing {
Expand All @@ -63,4 +71,10 @@ afterEvaluate { Project project ->
useInMemoryPgpKeys(inMemoryKey, project.findProperty('signing.password'))
}
}
tasks.named('publishAppyxReleasePublicationToSonatypeSnapshotRepository') { task ->
def fail = task.project.findProperty('snapshot') != 'true'
task.doFirst {
if (fail) throw new GradleException("Publishing to snapshot repository with disabled 'snapshot' flag is permitted")
}
}
}