|
| 1 | +name: Build and publish release |
| 2 | + |
| 3 | +runs: |
| 4 | + using: "composite" |
| 5 | + steps: |
| 6 | + - name: Get version |
| 7 | + id: get_version |
| 8 | + shell: bash |
| 9 | + run: | |
| 10 | + echo "version=$(python build/versionutils.py gradle.properties)" >> "$GITHUB_OUTPUT" |
| 11 | + - name: Run Gradle Test |
| 12 | + uses: ./actions/gradle-test |
| 13 | + with: |
| 14 | + gradle_args: -PreleaseBuild=true -PpublishBuild=true |
| 15 | + - name: Publish Artifacts |
| 16 | + uses: ./actions/run-gradle |
| 17 | + with: |
| 18 | + gradle_command: publish -PreleaseBuild=true -PpublishBuild=true -PgithubPublish=true -PcentralPublish=true |
| 19 | + |
| 20 | + # Post release: Update various files which reference version |
| 21 | + - name: Update release notes |
| 22 | + shell: bash |
| 23 | + run: ARTIFACT_VERSION="${{ steps.get_version.outputs.version }}" ./build/update_release_notes.bash |
| 24 | + - name: Update YAML test file versions |
| 25 | + uses: ./actions/run-gradle |
| 26 | + with: |
| 27 | + gradle_command: updateYamsql -PreleaseBuild=true |
| 28 | + - name: Commit YAML updates |
| 29 | + shell: bash |
| 30 | + run: python ./build/commit_yamsql_updates.py "${{ steps.get_version.outputs.version }}" |
| 31 | + |
| 32 | + # Create and push the tag |
| 33 | + - name: Create tag |
| 34 | + shell: bash |
| 35 | + run: git tag -m "Release ${{ steps.get_version_outputs.version }}" -f "${{ steps.get_version.outputs.version }}" |
| 36 | + - name: Push tag |
| 37 | + shell: bash |
| 38 | + run: git push origin "${{ steps.get_version.outputs.version }}" |
| 39 | + - name: Push Updates |
| 40 | + id: push_updates |
| 41 | + shell: bash |
| 42 | + run: git push origin |
| 43 | + - name: Create Merge PR if conflict |
| 44 | + if: failure() && steps.push_updates.conclusion == 'failure' |
| 45 | + uses: peter-evans/create-pull-request@v7 |
| 46 | + id: pr_on_conflict |
| 47 | + with: |
| 48 | + branch: release-build |
| 49 | + branch-suffix: timestamp |
| 50 | + title: "Updates for ${{ steps.get_version.outputs.version }} release" |
| 51 | + sign-commits: true |
| 52 | + body: | |
| 53 | + Updates from release for version ${{ steps.get_version.outputs.version }}. Conflicts during the build prevented automatic updating. Please resolve conflicts by checking out the current branch, merging, and then deleting this branch. |
0 commit comments