|
1 | | -name: Release |
2 | | - |
3 | | -on: |
4 | | - workflow_dispatch: |
5 | | - inputs: |
6 | | - version: |
7 | | - description: 'Release version (e.g., 1.0.0)' |
8 | | - required: true |
9 | | - type: string |
10 | | - |
11 | | -jobs: |
12 | | - release: |
13 | | - runs-on: ubuntu-latest |
14 | | - |
15 | | - permissions: |
16 | | - contents: write # Required to create releases and push commits |
17 | | - |
18 | | - # Uncomment to add an approval gate before releasing: |
19 | | - # environment: jreleaser |
20 | | - |
21 | | - env: |
22 | | - JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
23 | | - JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} |
24 | | - JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} |
25 | | - JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
26 | | - JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }} |
27 | | - JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }} |
28 | | - |
29 | | - steps: |
30 | | - - name: Checkout |
31 | | - uses: actions/checkout@v4 |
32 | | - with: |
33 | | - fetch-depth: 0 # Full history for changelog generation |
34 | | - |
35 | | - - name: Set up JDK 22 |
36 | | - uses: actions/setup-java@v4 |
37 | | - with: |
38 | | - java-version: '22' |
39 | | - distribution: 'temurin' |
40 | | - cache: maven |
41 | | - |
42 | | - - name: Set release version |
43 | | - run: | |
44 | | - ./mvnw --no-transfer-progress --batch-mode versions:set -DnewVersion=${{ inputs.version }} -DprocessAllModules=true versions:commit |
45 | | - find . -name "README.md" -exec sed -i \ |
46 | | - -e 's/\(org\.codejive\.miniterm:[^:]*\):[a-zA-Z0-9._-]*/\1:${{ inputs.version }}/g' \ |
47 | | - -e 's|<version>[^<]*</version>|<version>${{ inputs.version }}</version>|g' \ |
48 | | - {} \; |
49 | | - find examples -type f -exec sed -i \ |
50 | | - -e 's/\(org\.codejive\.miniterm:[^:]*\):[a-zA-Z0-9._-]*/\1:${{ inputs.version }}/g' \ |
51 | | - {} \; |
52 | | -
|
53 | | - - name: Build and deploy to staging |
54 | | - run: ./mvnw --no-transfer-progress --batch-mode clean deploy -Prelease |
55 | | - |
56 | | - - name: Commit release version |
57 | | - run: | |
58 | | - git config user.email "github-actions[bot]@users.noreply.github.com" |
59 | | - git config user.name "github-actions[bot]" |
60 | | - git add -A |
61 | | - git commit -m "ci: Releasing version ${{ inputs.version }}" |
62 | | - git push |
63 | | -
|
64 | | - - name: Run JReleaser |
65 | | - run: ./mvnw --no-transfer-progress --batch-mode jreleaser:full-release |
66 | | - |
67 | | - - name: Set next development version |
68 | | - run: | |
69 | | - ./mvnw --no-transfer-progress --batch-mode build-helper:parse-version versions:set "-DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT" -DprocessAllModules=true versions:commit |
70 | | -
|
71 | | - - name: Commit next development version |
72 | | - run: | |
73 | | - git add -A |
74 | | - git commit -m "ci: Prepare for next development iteration" |
75 | | - git push |
76 | | -
|
77 | | - - name: Upload JReleaser output |
78 | | - if: always() |
79 | | - uses: actions/upload-artifact@v4 |
80 | | - with: |
81 | | - name: jreleaser-output |
82 | | - path: | |
83 | | - target/jreleaser/trace.log |
84 | | - target/jreleaser/output.properties |
85 | | - retention-days: 7 |
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Release version (e.g., 1.0.0)' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + |
| 11 | +jobs: |
| 12 | + release: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + permissions: |
| 16 | + contents: write # Required to create releases and push commits |
| 17 | + |
| 18 | + # Uncomment to add an approval gate before releasing: |
| 19 | + # environment: jreleaser |
| 20 | + |
| 21 | + env: |
| 22 | + JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 23 | + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} |
| 24 | + JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} |
| 25 | + JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
| 26 | + JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }} |
| 27 | + JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }} |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + fetch-depth: 0 # Full history for changelog generation |
| 34 | + |
| 35 | + - name: Set up JDK 22 |
| 36 | + uses: actions/setup-java@v4 |
| 37 | + with: |
| 38 | + java-version: '22' |
| 39 | + distribution: 'temurin' |
| 40 | + cache: maven |
| 41 | + |
| 42 | + - name: Set release version |
| 43 | + run: | |
| 44 | + ./mvnw --no-transfer-progress --batch-mode versions:set -DnewVersion=${{ inputs.version }} -DprocessAllModules=true versions:commit |
| 45 | + find . -name "README.md" -exec sed -i \ |
| 46 | + -e 's/\(org\.codejive\.miniterm:[^:]*\):[a-zA-Z0-9._-]*/\1:${{ inputs.version }}/g' \ |
| 47 | + -e 's|<version>[^<]*</version>|<version>${{ inputs.version }}</version>|g' \ |
| 48 | + {} \; |
| 49 | + find examples -type f -exec sed -i \ |
| 50 | + -e 's/\(org\.codejive\.miniterm:[^:]*\):[a-zA-Z0-9._-]*/\1:${{ inputs.version }}/g' \ |
| 51 | + {} \; |
| 52 | +
|
| 53 | + - name: Build and deploy to staging |
| 54 | + run: ./mvnw --no-transfer-progress --batch-mode clean deploy -Prelease |
| 55 | + |
| 56 | + - name: Commit release version |
| 57 | + run: | |
| 58 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 59 | + git config user.name "github-actions[bot]" |
| 60 | + git add -A |
| 61 | + git commit -m "ci: Releasing version ${{ inputs.version }}" |
| 62 | + git push |
| 63 | +
|
| 64 | + - name: Run JReleaser |
| 65 | + run: ./mvnw --no-transfer-progress --batch-mode jreleaser:full-release |
| 66 | + |
| 67 | + - name: Set next development version |
| 68 | + run: | |
| 69 | + ./mvnw --no-transfer-progress --batch-mode build-helper:parse-version versions:set "-DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT" -DprocessAllModules=true versions:commit |
| 70 | +
|
| 71 | + - name: Commit next development version |
| 72 | + run: | |
| 73 | + git add -A |
| 74 | + git commit -m "ci: Prepare for next development iteration" |
| 75 | + git push |
| 76 | +
|
| 77 | + - name: Upload JReleaser output |
| 78 | + if: always() |
| 79 | + uses: actions/upload-artifact@v4 |
| 80 | + with: |
| 81 | + name: jreleaser-output |
| 82 | + path: | |
| 83 | + target/jreleaser/trace.log |
| 84 | + target/jreleaser/output.properties |
| 85 | + retention-days: 7 |
0 commit comments