Skip to content

Commit 3faf2de

Browse files
authored
Prepare repo for release (#664)
Update actions to match other libraries. Add change log and PR template for tracking future changes. Set up Dokka multi-module publishing.
1 parent 1262017 commit 3faf2de

File tree

12 files changed

+220
-95
lines changed

12 files changed

+220
-95
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
3+
- [ ] `CHANGELOG.md`'s "Unreleased" section has been updated, if applicable.

.github/workflows/PR.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/SNAPSHOT.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: build
2+
3+
on:
4+
pull_request: {}
5+
workflow_dispatch: {}
6+
push:
7+
branches:
8+
- 'master'
9+
tags-ignore:
10+
- '**'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-java@v4
19+
with:
20+
distribution: 'zulu'
21+
java-version-file: .github/workflows/.java-version
22+
- uses: gradle/actions/setup-gradle@v4
23+
24+
- run: ./gradlew build dokkaHtmlMultiModule
25+
26+
- run: ./gradlew publish
27+
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'sqldelight/sql-psi' }}
28+
env:
29+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME_APP_CASH }}
30+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD_APP_CASH }}
31+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
32+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}
33+
34+
- name: Deploy docs to website
35+
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'sqldelight/sql-psi' }}
36+
uses: JamesIves/github-pages-deploy-action@releases/v3
37+
with:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
BRANCH: site
40+
FOLDER: build/dokka/htmlMultiModule
41+
TARGET_FOLDER: docs/latest/
42+
CLEAN: true

.github/workflows/release.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- '**'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-java@v4
16+
with:
17+
distribution: 'zulu'
18+
java-version-file: .github/workflows/.java-version
19+
- uses: gradle/actions/setup-gradle@v4
20+
21+
- run: ./gradlew publish
22+
env:
23+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME_APP_CASH }}
24+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD_APP_CASH }}
25+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}
27+
28+
- name: Extract release notes
29+
id: extract-release-notes
30+
uses: ffurrer2/extract-release-notes@v2
31+
with:
32+
release_notes_file: RELEASE_NOTES.md
33+
34+
- name: Create GitHub release
35+
run: gh release create ${{ github.ref_name }} --notes-file RELEASE_NOTES.md
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- run: ./gradlew dokkaHtmlMultiModule
40+
41+
- name: Deploy docs to website
42+
uses: JamesIves/github-pages-deploy-action@releases/v3
43+
with:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
BRANCH: site
46+
FOLDER: build/dokka/htmlMultiModule
47+
TARGET_FOLDER: docs/1.x/
48+
CLEAN: true

CHANGELOG.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Change Log
2+
3+
## Unreleased
4+
5+
Nothing yet!
6+
7+
## 0.4.10
8+
9+
## 0.4.9
10+
11+
## 0.4.8
12+
13+
## 0.4.7
14+
15+
## 0.4.6
16+
17+
## 0.4.5
18+
19+
## 0.4.4
20+
21+
## 0.4.3
22+
23+
## 0.4.2
24+
25+
## 0.4.1
26+
27+
## 0.4.0
28+
29+
## 0.3.17
30+
31+
## 0.3.15
32+
33+
## 0.3.14
34+
35+
## 0.3.12
36+
37+
## 0.3.11
38+
39+
## 0.3.10
40+
41+
## 0.3.9
42+
43+
## 0.3.8
44+
45+
## 0.3.7
46+
47+
## 0.3.6
48+
49+
## 0.3.5
50+
51+
## 0.3.4
52+
53+
## 0.3.3
54+
55+
## 0.3.2
56+
57+
## 0.3.1
58+
59+
## 0.3.0
60+
61+
## 0.2.4
62+
63+
## 0.2.3
64+
65+
## 0.2.2
66+
67+
## 0.2.1
68+
69+
## 0.2.0
70+
71+
## 0.1.9
72+
73+
## 0.1.8
74+
75+
## 0.1.7
76+
77+
## 0.1.6
78+
79+
## 0.1.5
80+
81+
## 0.1.4
82+
83+
## 0.1.3
84+
85+
## 0.1.2
86+
87+
## 0.1.1
88+
89+
## 0.1.0

RELEASING.md

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
1-
Releasing
2-
=========
1+
# Releasing
32

4-
1. Change the version in `gradle.properties` to a non-SNAPSHOT verson.
5-
2. Update the `CHANGELOG.md` for the impending release.
6-
3. Update the `README.md` with the new version.
7-
4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
8-
5. `./gradlew clean publish --no-parallel`.
9-
6. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact.
10-
7. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
11-
8. Update the `gradle.properties` to the next SNAPSHOT version.
12-
9. `git commit -am "Prepare next development version."`
13-
10. `git push && git push --tags`
14-
11. Update the sample app to the release version and send a PR.
3+
1. Update the `VERSION_NAME` in `gradle.properties` to the release version.
154

16-
If step 6 or 7 fails, drop the Sonatype repo, fix the problem, commit, and start again at step 5.
5+
2. Update the `CHANGELOG.md`:
6+
1. Change the `Unreleased` header to the release version.
7+
2. Add a link URL to ensure the header link works.
8+
3. Add a new `Unreleased` section to the top.
179

10+
3. Commit
1811

19-
Prerequisites
20-
-------------
12+
```
13+
$ git commit -am "Prepare version X.Y.Z"
14+
```
2115

22-
In `~/.gradle/gradle.properties`, set the following:
16+
4. Tag
2317

24-
* `SONATYPE_NEXUS_USERNAME` - Sonatype username for releasing to `com.squareup`.
25-
* `SONATYPE_NEXUS_PASSWORD` - Sonatype password for releasing to `com.squareup`.
18+
```
19+
$ git tag -am "Version X.Y.Z" X.Y.Z
20+
```
21+
22+
5. Update the `VERSION_NAME` in `gradle.properties` to the next "SNAPSHOT" version.
23+
24+
6. Commit
25+
26+
```
27+
$ git commit -am "Prepare next development version"
28+
```
29+
30+
7. Push!
31+
32+
```
33+
$ git push && git push --tags
34+
```
35+
36+
This will trigger a GitHub Action workflow which will create a GitHub release and upload the
37+
release artifacts to Maven Central.

build.gradle

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
plugins {
44
alias(libs.plugins.kotlinJvm) apply false
55
alias(libs.plugins.spotless)
6-
alias(libs.plugins.mavenPublish)
6+
alias(libs.plugins.mavenPublish) apply false
77
alias(libs.plugins.dokka)
88
}
99

@@ -29,14 +29,9 @@ allprojects {
2929
maven { url "https://cache-redirector.jetbrains.com/intellij-dependencies" }
3030
maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies" }
3131
}
32-
33-
group = GROUP
34-
version = VERSION_NAME
3532
}
3633

3734
subprojects {
38-
apply(plugin: "org.jetbrains.kotlin.jvm")
39-
4035
tasks.withType(JavaCompile).configureEach {
4136
sourceCompatibility = '11'
4237
targetCompatibility = '11'

core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
plugins {
22
alias(libs.plugins.kotlinJvm)
33
alias(libs.plugins.grammarKitComposer)
4+
alias(libs.plugins.mavenPublish)
5+
alias(libs.plugins.dokka)
46
id("java-test-fixtures")
57
}
68

7-
apply from: "$rootDir/gradle/gradle-mvn-push.gradle"
8-
99
grammarKit {
1010
intellijRelease.set(libs.versions.ideaVersion)
1111
}

environment/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
plugins {
22
alias(libs.plugins.kotlinJvm)
3+
alias(libs.plugins.mavenPublish)
4+
alias(libs.plugins.dokka)
35
}
46

5-
apply from: "$rootDir/gradle/gradle-mvn-push.gradle"
6-
77
dependencies {
88
implementation projects.core
99
compileOnly libs.bundles.intelliJ

0 commit comments

Comments
 (0)