|
1 | 1 | name: Release
|
| 2 | +run-name: ${{ format('Release version {0}', inputs.version)}} by @${{ github.actor }} |
2 | 3 |
|
3 | 4 | on:
|
4 | 5 | workflow_dispatch:
|
|
11 | 12 | description: 'Next SNAPSHOT version (without v). Defaults to current value'
|
12 | 13 | required: false
|
13 | 14 | type: string
|
| 15 | + pull_request: |
14 | 16 |
|
15 | 17 | jobs:
|
16 | 18 | publish:
|
@@ -42,14 +44,47 @@ jobs:
|
42 | 44 | # Disable writing to cache. Don't want to spoil the main cache
|
43 | 45 | cache-read-only: true
|
44 | 46 |
|
45 |
| - - name: Release |
46 |
| - run: ./scripts/release.sh ${{ inputs.version }} ${{ inputs.snapshot }} |
| 47 | + - name: Get Snaptshot versions |
| 48 | + id: snapshotVersions |
| 49 | + run: ./scripts/get_next_snapshot_version.sh ${{ inputs.snapshot }} |
| 50 | + |
| 51 | + - name: Prepare for release metadata |
| 52 | + shell: bash |
| 53 | + run: | |
| 54 | + sed -i.bak "s/${{ steps.snapshotVersions.cur_snapshot_version }}/${{ steps.snapshotVersions.new_snapshot_version }}/g" gradle.properties |
| 55 | +
|
| 56 | + - name: Commit gradle.properties and set tag for v${{ inputs.version }} |
| 57 | + uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v2 |
| 58 | + with: |
| 59 | + add: 'gradle.properties' |
| 60 | + message: 'Prepare for release: ${{ inputs.version }}' |
| 61 | + tag: v${{ inputs.version }} |
| 62 | + |
| 63 | + - name: Deploy v${{ inputs.version }} |
| 64 | + run: ./gradlew publish |
47 | 65 | env:
|
48 | 66 | ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_REPO_USERNAME }}
|
49 | 67 | ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_REPO_PASSWORD }}
|
50 | 68 | ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
|
51 | 69 | ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
|
52 | 70 |
|
| 71 | + - name: Prepare next Snapshot version ${{ steps.snapshotVersions.new_snapshot_version }} |
| 72 | + shell: bash |
| 73 | + run: | |
| 74 | + echo "Setting next snapshot version ${{ steps.snapshotVersions.new_snapshot_version }}" |
| 75 | + sed -i.bak "s/${{ inputs.version }}/${{ steps.snapshotVersions.new_snapshot_version }}/g" gradle.properties |
| 76 | +
|
| 77 | + - name: Commit gradle.properties for Snapshot version ${{ steps.snapshotVersions.new_snapshot_version }} |
| 78 | + uses: IABTechLab/uid2-shared-actions/actions/commit_pr_and_merge@v2 |
| 79 | + with: |
| 80 | + add: 'gradle.properties' |
| 81 | + message: 'Prepare next development version: ${{ steps.snapshotVersions.new_snapshot_version }}' |
| 82 | + |
| 83 | + - name: Remove the backup file from sed edits |
| 84 | + shell: bash |
| 85 | + run: | |
| 86 | + rm gradle.properties.bak |
| 87 | +
|
53 | 88 | - name: GitHub Release
|
54 | 89 | uses: softprops/action-gh-release@v1
|
55 | 90 | with:
|
|
0 commit comments