Skip to content

Commit 9d34f51

Browse files
committed
Workflow cleanup and release doc
1 parent 0054820 commit 9d34f51

4 files changed

Lines changed: 90 additions & 37 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
runs-on: ${{matrix.os}}
1717
steps:
1818
- name: Checkout the repo
19-
uses: actions/checkout@v7
19+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2020

21-
- uses: actions/setup-java@v5
21+
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
2222
with:
2323
distribution: "temurin"
2424
java-version: "17"
@@ -32,15 +32,7 @@ jobs:
3232
install: git mingw-w64-x86_64-toolchain libsqlite
3333

3434
- name: Setup Gradle
35-
uses: gradle/actions/setup-gradle@v6
36-
37-
- name: Cache konan
38-
uses: actions/cache@v4
39-
with:
40-
path: ~/.konan
41-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
42-
restore-keys: |
43-
${{ runner.os }}-gradle-
35+
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
4436

4537
- name: Update Environment Variables
4638
if: matrix.os == 'windows-latest'

‎.github/workflows/release.yml‎

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
11
name: release
2-
on: workflow_dispatch
2+
on:
3+
push:
4+
tags:
5+
- "[0-9]+.[0-9]+.[0-9]+"
36

47
jobs:
5-
release:
8+
publish:
69
runs-on: macos-latest
710
steps:
811
- name: Checkout the repo
9-
uses: actions/checkout@v7
12+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1013

11-
- uses: touchlab/read-property@0.1
12-
id: version-name
13-
with:
14-
file: ./gradle.properties
15-
property: VERSION_NAME
16-
17-
- name: Echo Version
18-
run: echo "${{ steps.version-name.outputs.propVal }}"
19-
20-
- uses: actions/setup-java@v5
14+
- uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
2115
with:
2216
distribution: "temurin"
2317
java-version: "17"
24-
- name: Setup Gradle
25-
uses: gradle/actions/setup-gradle@v6
2618

27-
- name: Cache konan
28-
uses: actions/cache@v4
29-
with:
30-
path: ~/.konan
31-
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}
32-
restore-keys: |
33-
${{ runner.os }}-gradle-
19+
- name: Setup Gradle
20+
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
3421

3522
- name: Publish Artifacts to Maven Central
3623
run: ./gradlew publish --no-daemon --stacktrace --no-build-cache
@@ -39,11 +26,18 @@ jobs:
3926
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
4027
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
4128

29+
release:
30+
needs: publish
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: write
34+
steps:
35+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
36+
4237
- name: Create Release
43-
if: ${{ contains(steps.version-name.outputs.propVal, 'SNAPSHOT') == false }}
44-
uses: touchlab/release-action@v1.10.0
38+
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
4539
with:
46-
tag: ${{ steps.version-name.outputs.propVal }}
40+
generate_release_notes: true
4741

4842
env:
4943
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m"

‎RELEASING.md‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Releasing
2+
3+
SQLiter publishes `co.touchlab:sqliter-driver` to Maven Central. Releases are cut by pushing a release
4+
tag.
5+
6+
## Conventions
7+
8+
- Tags are the bare version, no `v` prefix — `1.4.0`, not `v1.4.0`.
9+
- The tag and `VERSION_NAME` must be identical.
10+
- `main` sits on a `-SNAPSHOT` between releases.
11+
12+
## Choosing the version
13+
14+
Standard semver against the published API surface:
15+
16+
- **Patch** — bug fixes, no public declarations added or changed.
17+
- **Minor** — public declarations added.
18+
- **Major** — public declarations removed or changed incompatibly.
19+
20+
## Releasing
21+
22+
Steps 1–6 are local. Nothing is published until you push the tag in step 7.
23+
24+
1. **Confirm the working tree is clean and `main` is current.**
25+
2. **Set the release version** in `gradle.properties`:
26+
27+
```
28+
VERSION_NAME=X.Y.Z
29+
```
30+
31+
3. **Commit.**
32+
33+
```bash
34+
git commit -am "Prepare version X.Y.Z"
35+
```
36+
37+
4. **Tag that commit.**
38+
39+
```bash
40+
git tag -a X.Y.Z -m "Version X.Y.Z"
41+
```
42+
43+
5. **Set the next development version.** Bump the patch and re-add the suffix in
44+
`gradle.properties`:
45+
46+
```
47+
VERSION_NAME=<next patch>-SNAPSHOT
48+
```
49+
50+
So releasing `1.4.1` leaves `main` on `VERSION_NAME=1.4.2-SNAPSHOT`.
51+
52+
6. **Commit.**
53+
54+
```bash
55+
git commit -am "Prepare next development version"
56+
```
57+
58+
7. **Push the branch first, then the tag.** Pushing the tag triggers the release, so push it last:
59+
60+
```bash
61+
git push origin main
62+
git push origin X.Y.Z
63+
```
64+
65+
Pushing requires bypassing main branch protections, if you're not set up to do this, you probably shouldn't be
66+
publishing anyway
67+

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kotlin.code.style=official
22

33
GROUP=co.touchlab
44

5-
VERSION_NAME=1.4.0
5+
VERSION_NAME=1.4.1-SNAPSHOT
66
KOTLIN_VERSION=2.2.10
77

88
kotlin.native.ignoreDisabledTargets=true

0 commit comments

Comments
 (0)