Updated for GW2 update #214
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
env: | |
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: [ master ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: windows-2022 | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Enable Developer Command Prompt | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: amd64 | |
- name: Generate version information | |
run: powershell "${env:GITHUB_WORKSPACE}\Version.ps1" -ref "${{github.ref}}" -sha "${{github.sha}}" | |
- uses: nuget/setup-nuget@v1 | |
with: | |
nuget-version: '5.x' | |
- run: nuget restore "${env:GITHUB_WORKSPACE}\GW2Clarity.sln" | |
- name: Export GitHub Actions cache environment variables | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | |
- name: Build Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: msbuild.exe "${env:GITHUB_WORKSPACE}\GW2Clarity.sln" /t:Build /p:Configuration=Release /p:Platform=x64 /p:GitHubDefs=USE_GITHUB_VER | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
- name: Build Debug | |
run: msbuild.exe "${env:GITHUB_WORKSPACE}\GW2Clarity.sln" /t:Build /p:Configuration=Debug /p:Platform=x64 /p:GitHubDefs=USE_GITHUB_VER | |
env: | |
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | |
- name: Save nightly build from master | |
uses: actions/upload-artifact@v3 | |
if: startsWith(github.ref, 'refs/tags/v') == false | |
with: | |
name: nightly-${{ github.sha }} | |
path: | | |
x64/Debug/gw2addon_gw2clarity.dll | |
x64/Debug/gw2addon_gw2clarity.pdb | |
x64/Debug/getbuffs.dll | |
x64/Debug/readme.md | |
- name: Move files for tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
mkdir -p x64/Release/gw2clarity | |
mkdir -p x64/Debug/gw2clarity | |
mv x64/Release/gw2addon_gw2clarity.dll x64/Release/gw2clarity/ | |
mv x64/Release/getbuffs.dll x64/Release/gw2clarity/ | |
mv x64/Release/readme.md x64/Release/gw2clarity/ | |
mv x64/Debug/gw2addon_gw2clarity.dll x64/Debug/gw2clarity/ | |
mv x64/Debug/gw2addon_gw2clarity.pdb x64/Debug/gw2clarity/ | |
mv x64/Debug/getbuffs.dll x64/Debug/gw2clarity/ | |
- name: Zip files for tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
cd x64/Release | |
7z a ../../gw2clarity.zip gw2clarity/ | |
7z a ../../gw2clarity_pdb.zip gw2addon_gw2clarity.pdb | |
cd ../.. | |
cd x64/Debug | |
7z a ../../gw2clarity_debug.zip gw2clarity/ | |
cd ../.. | |
- name: Create release draft for tag | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: ${{ contains(github.ref, '-pre') }} | |
files: | | |
gw2clarity.zip | |
gw2clarity_pdb.zip | |
gw2clarity_debug.zip | |