Merge to master for v0.2.2 #11
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: | |
doc_artifact_path: ${{ github.workspace }}/DocArtifact | |
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 }} | |
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: 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_qi_qmp_release_windows: | |
name: Build QI-QMP Release (Windows) | |
needs: tag_master_and_sync_dev | |
if: github.event.pull_request.merged == true | |
uses: ./.github/workflows/build-qi-qmp-windows.yml | |
secrets: | |
qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} | |
build_qi_qmp_release_linux: | |
name: Build QI-QMP Release (Linux) | |
needs: tag_master_and_sync_dev | |
if: github.event.pull_request.merged == true | |
uses: ./.github/workflows/build-qi-qmp-linux.yml | |
secrets: | |
qt_ffynnon_cred: ${{ secrets.OBYBOT_FFYNNON_CREDS }} | |
update-docs: | |
name: Update gh-pages | |
needs: [build_qi_qmp_release_windows] | |
if: github.event.pull_request.merged == true | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.page-deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download built shared QI-QMP artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ needs.build_qi_qmp_release_windows.outputs.doc_artifact_name }} | |
path: ${{ env.doc_artifact_path }} | |
- name: Setup pages | |
uses: actions/configure-pages@v3 | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ${{ env.doc_artifact_path }}/doc/html | |
- name: Deploy pages artifact | |
id: page-deployment | |
uses: actions/deploy-pages@v1 | |
create-release: | |
name: Create GitHub release | |
needs: [update-docs, build_qi_qmp_release_windows, build_qi_qmp_release_linux, tag_master_and_sync_dev] | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download built QI-QMP artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ${{ env.artifacts_path }} | |
- name: Zip up release artifacts | |
shell: pwsh | |
run: | | |
$artifact_folders = Get-ChildItem -Directory -Path "${{ env.artifacts_path }}" -Exclude "github-pages" | |
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@v1 | |
with: | |
name: "QI-QMP Release v${{ needs.tag_master_and_sync_dev.outputs.new_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 | |