GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ci: automate release creation and artifact uploading (#6) · testlens-app/cli@ee0e741

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • release.yml
  • build.gradle.kts
  • gradle/plugins/src/main/kotlin
    • app.testlens.gradle.component.application-cli.gradle.kts
    • app.testlens.gradle.feature.release.gradle.kts
  • src/test/java/app/testlens/cli
    • VersionTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/release.yml‎

Copy file name to clipboard
+69Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
permissions: {}
10+
11+
jobs:
12+
graalvm:
13+
strategy:
14+
matrix:
15+
os:
16+
- runner: ubuntu
17+
label: linux
18+
- runner: macos
19+
label: macos
20+
- runner: windows
21+
label: windows
22+
fail-fast: false
23+
runs-on: ${{ matrix.os.runner }}-latest
24+
name: GraalVM Native Image (${{ matrix.os.label }})
25+
steps:
26+
- name: standardize git line endings
27+
run: |
28+
git config --global core.autocrlf false
29+
git config --global core.eol lf
30+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31+
with:
32+
fetch-depth: 1
33+
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
34+
with:
35+
distribution: graalvm
36+
java-version-file: gradle/java-version.txt
37+
- uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
38+
with:
39+
build-scan-terms-of-use-url: https://gradle.com/terms-of-service
40+
build-scan-terms-of-use-agree: yes
41+
- uses: testlens-app/setup-testlens@d29a2be31512b3aeda3adcef09fbe0d55af90c51 # v1.9.4
42+
- run: ./gradlew signReleaseArchive
43+
env:
44+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
45+
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
46+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
47+
with:
48+
name: testlens-${{ matrix.os.label }}
49+
path: build/release/**
50+
if-no-files-found: error
51+
52+
create_release:
53+
needs: graalvm
54+
name: Create GitHub release
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: write
58+
steps:
59+
- uses: actions/[email protected]
60+
with:
61+
pattern: testlens-*
62+
merge-multiple: true
63+
- run: ls -alR
64+
- uses: softprops/action-gh-release@v3
65+
with:
66+
generate_release_notes: true
67+
draft: true
68+
make_latest: true
69+
files: testlens-*
Collapse file

‎build.gradle.kts‎

Copy file name to clipboardExpand all lines: build.gradle.kts
+13-1Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@ plugins {
22
id("app.testlens.gradle.component.application-cli")
33
}
44

5-
version = "0.1.0"
5+
/**
6+
* Releasing:
7+
* 1. Change the version to the version that you want to release
8+
* 2. Commit the change, but don't push yet
9+
* - commit message: "chore: release 1.x.x"
10+
* 3. Tag the commit as `v<version>` where `<version>` is the version you want to release
11+
* - run: git tag -s v1.x.x -m v1.x.x
12+
* 3. Change the version to the next development SNAPSHOT version
13+
* 4. Commit the change:
14+
* - commit message: "chore: use next snapshot version"
15+
* 5. Push everything by running `git push --follow-tags`
16+
*/
17+
version = "1.0.0-SNAPSHOT"
618

719
dependencies {
820
implementation(libs.diffUtils)
Collapse file

‎gradle/plugins/src/main/kotlin/app.testlens.gradle.component.application-cli.gradle.kts‎

Copy file name to clipboardExpand all lines: gradle/plugins/src/main/kotlin/app.testlens.gradle.component.application-cli.gradle.kts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ plugins {
1414
id("app.testlens.gradle.check.format-java")
1515
id("app.testlens.gradle.check.javac-lint")
1616
id("app.testlens.gradle.feature.java-compile")
17+
id("app.testlens.gradle.feature.release")
1718
id("app.testlens.gradle.feature.test")
1819
id("application")
1920
id("org.openapi.generator")
Collapse file

‎gradle/plugins/src/main/kotlin/app.testlens.gradle.feature.release.gradle.kts‎

Copy file name to clipboard
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import org.gradle.internal.os.OperatingSystem
2+
3+
plugins {
4+
signing
5+
id("org.graalvm.buildtools.native")
6+
}
7+
8+
val assembleReleaseArchive = tasks.register<Zip>("assembleReleaseArchive") {
9+
from(tasks.named("nativeCompile"))
10+
into(provider { "testlens-${version}" })
11+
destinationDirectory = project.layout.buildDirectory.dir("release")
12+
val os = OperatingSystem.current()
13+
val osName = when {
14+
os.isLinux -> "linux"
15+
os.isMacOsX -> "macos"
16+
os.isWindows -> "windows"
17+
else -> error("Unsupported OS: $os")
18+
}
19+
archiveBaseName = "testlens-$osName"
20+
}
21+
22+
signing {
23+
useInMemoryPgpKeys(
24+
providers.environmentVariable("SIGNING_KEY").orNull,
25+
providers.environmentVariable("SIGNING_PASSPHRASE").orNull,
26+
)
27+
}
28+
29+
tasks.register<Sign>("signReleaseArchive") {
30+
sign(assembleReleaseArchive.get())
31+
}
Collapse file

‎src/test/java/app/testlens/cli/VersionTest.java‎

Copy file name to clipboardExpand all lines: src/test/java/app/testlens/cli/VersionTest.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void printsVersion() {
1313
var result = run("--version");
1414

1515
assertThat(result.exitCode()).isZero();
16-
assertThat(result.stdout().trim()).matches("\\d+(\\.\\d+)+");
16+
assertThat(result.stdout().trim()).matches("\\d+(\\.\\d+)+(-SNAPSHOT)?");
1717
assertThat(result.stderr()).isEmpty();
1818
}
1919
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.