Merge to master for v0.7.5.1 #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Master pull-request merge reaction | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- 'master' | |
env: | |
artifacts_path: ${{ github.workspace }}/Artifacts | |
zips_path: ${{ github.workspace }}/Zips | |
jobs: | |
tag_master_and_sync_dev: | |
name: Tag master merge commit, FF back to dev | |
if: github.event.pull_request.merged == true | |
runs-on: windows-latest | |
outputs: | |
new_version: ${{ steps.get-proj-ver.outputs.version }} | |
target_fp_version: ${{ steps.check_target_fp.outputs.fp_version }} | |
steps: | |
- name: Get project version | |
id: get-proj-ver | |
uses: oblivioncth/actions/cmake/get-project-version@dev | |
- name: Set Git user to ObyBotCI | |
uses: oblivioncth/actions/git/set-git-user-to-oby-bot@dev | |
- name: Checkout Project | |
id: proj-checkout | |
uses: oblivioncth/actions/git/smart-checkout@dev | |
- name: Get target FP version | |
id: check_target_fp | |
working-directory: ${{ steps.proj-checkout.outputs.path }} | |
env: | |
match_start: set\(TARGET_FP_VERSION_PREFIX | |
match_end: \) | |
run: | | |
$project_lists = Get-Content -Raw CMakeLists.txt | |
if(!($project_lists -match '(?<=${{ env.match_start }})(.*)(?=${{ env.match_end }})')){ | |
throw "Could not get target FP version!" | |
} | |
$target_version = "v$($Matches[1].Trim())" | |
echo "fp_version=$target_version" >> $Env:GITHUB_OUTPUT | |
- name: Tag master with new version tag | |
uses: oblivioncth/actions/git/tag@dev | |
with: | |
tag: 'v${{ steps.get-proj-ver.outputs.version }}' | |
message: 'Release v${{ steps.get-proj-ver.outputs.version }}' | |
- name: Move 'latest' tag | |
uses: oblivioncth/actions/git/move-latest-tag@dev | |
- name: Fast-forward merge master into to dev | |
if: always() | |
uses: oblivioncth/actions/git/merge-branches@dev | |
with: | |
source_branch: master | |
target_branch: dev | |
ff: only | |
build_fil_release_windows: | |
name: Build FIL Release (Windows) | |
needs: tag_master_and_sync_dev | |
if: github.event.pull_request.merged == true | |
uses: ./.github/workflows/build-fil-windows.yml | |
secrets: | |
qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} | |
create-release: | |
name: Create GitHub release | |
needs: [build_fil_release_windows, tag_master_and_sync_dev] | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download built static FIL artifact (Windows) | |
uses: actions/download-artifact@v4 | |
with: | |
path: ${{ env.artifacts_path }} | |
- name: Zip up release artifacts | |
shell: pwsh | |
run: | | |
$artifact_folders = Get-ChildItem -Directory -Path "${{ env.artifacts_path }}" | |
foreach($art_dir in $artifact_folders) | |
{ | |
$name = $art_dir.name | |
$path = $art_dir.fullname | |
7z a "${{ env.zips_path }}/${name}.zip" "${path}/*" | |
} | |
- name: Generate release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: "FIL Release v${{ needs.tag_master_and_sync_dev.outputs.new_version }} (Targets FP ${{ needs.tag_master_and_sync_dev.outputs.target_fp_version }})" | |
tag_name: "v${{ needs.tag_master_and_sync_dev.outputs.new_version }}" | |
fail_on_unmatched_files: true | |
generate_release_notes: true | |
files: | | |
${{ env.zips_path }}/*.zip | |