aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/update_release.yml
diff options
context:
space:
mode:
authorAlex Dunn <[email protected]>2022-04-15 14:03:23 -0700
committerGitHub <[email protected]>2022-04-15 14:03:23 -0700
commit36cf26ae05a4db0353cac115d3e596c0fde44f6c (patch)
treea68edb75c1221e4246612dd2fe36da9a49c00f8b /.github/workflows/update_release.yml
parentHorde execute storage config (#75) (diff)
parentMaking changes to the CI/CD pipeline and adding release automation for PR mer... (diff)
downloadzen-1.0.0.2.tar.xz
zen-1.0.0.2.zip
Merge pull request #76 from EpicGames/ci_updatesv1.0.0.2
Making changes to the CI/CD pipeline and adding release automation
Diffstat (limited to '.github/workflows/update_release.yml')
-rw-r--r--.github/workflows/update_release.yml124
1 files changed, 124 insertions, 0 deletions
diff --git a/.github/workflows/update_release.yml b/.github/workflows/update_release.yml
new file mode 100644
index 000000000..62568d1c0
--- /dev/null
+++ b/.github/workflows/update_release.yml
@@ -0,0 +1,124 @@
+name: Build release
+
+on:
+ # push
+ pull_request:
+ types: [closed]
+ branches: [ main ]
+
+jobs:
+ windows-build:
+ # if: github.event.pull_request.merged == true
+ name: Build Windows
+ runs-on: [self-hosted, windows, x64]
+ strategy:
+ matrix:
+ config:
+ - 'release'
+ arch:
+ - 'x64'
+ env:
+ VCPKG_VERSION: 2022.03.10
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Setup xmake
+ uses: xmake-io/github-action-setup-xmake@v1
+ with:
+ xmake-version: 2.6.4
+
+ - name: Installing vcpkg
+ run: |
+ git clone -b ${{env.VCPKG_VERSION}} --single-branch https://github.com/Microsoft/vcpkg.git .vcpkg
+ cd .vcpkg
+ .\bootstrap-vcpkg.bat
+ .\vcpkg.exe integrate install
+ cd ..
+
+ - name: Cache vcpkg
+ uses: actions/cache@v2
+ with:
+ path: |
+ ${{ github.workspace }}\.vcpkg\installed
+ key: ${{ runner.os }}-${{ matrix.config }}-${{env.VCPKG_VERSION}}-${{ hashFiles('xmake.lua') }}-${{ matrix.arch }}-v5
+
+ - name: Config
+ run: |
+ xmake config -v -y -m ${{ matrix.config }} --arch=${{ matrix.arch }}
+ env:
+ VCPKG_ROOT: ${{ github.workspace }}/.vcpkg
+
+ - name: Build
+ run: |
+ xmake build -v -y
+ env:
+ VCPKG_ROOT: ${{ github.workspace }}/.vcpkg
+
+ # - name: Create Archive
+ # run: |
+ # cd .\build\windows\${{ matrix.arch }}\${{ matrix.config }}
+ # C:\'Program Files'\7-Zip\7z.exe a -r ..\..\..\..\windows-${{ matrix.arch }}-${{ matrix.config }}.zip *
+ # cd ..\..\..\..
+
+ - name: Create Archive
+ run: |
+ cd .\build\windows\${{ matrix.arch }}\${{ matrix.config }}
+ C:\'Program Files'\7-Zip\7z.exe a -r ..\..\..\..\zenserver-win64.zip zenserver.exe
+ cd ..\..\..\..
+
+ - name: Get current release version info
+ run: |
+ $repo = "EpicGames/zen"
+ $releases = "https://api.github.com/repos/$repo/releases/latest"
+ Write-Host Determining latest release
+ $latest = (Invoke-WebRequest -Headers @{"Accept"="application/vnd.github.v3+json";"Authorization"="token ${{ secrets.GITHUB_TOKEN }}"} $releases | ConvertFrom-Json)[0]
+ $current_version_tag = [version]$latest.tag_name.replace('v','')
+ echo "Current version" $current_version_tag
+ $new_version_tag = [version]::New($current_version_tag.Major,$current_version_tag.Minor,$current_version_tag.Build,$current_version_tag.Revision+1).toString()
+ echo $new_version_tag
+ echo "new_version_tag=$new_version_tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
+
+ - name: Create Release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: v${{ env.new_version_tag }}
+ release_name: Release
+ draft: false
+ prerelease: false
+
+ # - name: Create Release
+ # id: create_release
+ # uses: actions/create-release@v1
+ # env:
+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # with:
+ # tag_name: ${{ github.ref_name }}
+ # release_name: Release ${{ github.head_ref }}
+ # draft: false
+ # prerelease: false
+
+ # - name: Upload Release Asset
+ # id: upload-release-asset
+ # uses: actions/upload-release-asset@v1
+ # env:
+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # with:
+ # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
+ # asset_path: .\windows-${{ matrix.arch }}-${{ matrix.config }}.zip
+ # asset_name: windows-${{ matrix.arch }}-${{ matrix.config }}
+ # asset_content_type: application/zip
+ - name: Upload Release Asset
+ id: upload-release-asset
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: .\zenserver-win64.zip
+ asset_name: zenserver-win64.zip
+ asset_content_type: application/zip
+