Merge branch 'OverlayPlugin:main' into main #2
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: Create OverlayPlugin Release | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'Directory.Build.props' | |
jobs: | |
validate_tag: | |
runs-on: windows-latest | |
outputs: | |
version: ${{ steps.determine_version.outputs.version }} | |
do_release: ${{ steps.check_tag.outputs.do_release }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Fetch all history for all tags | |
- name: Determine Version | |
id: determine_version | |
shell: pwsh | |
run: | | |
[xml]$csprojcontents = Get-Content -Path "Directory.Build.props"; | |
$version = $csprojcontents.Project.PropertyGroup.AssemblyVersion; | |
$version = ($version | Out-String).Trim() | |
echo "version=$version" >> $env:GITHUB_OUTPUT | |
- name: Check Tag Exists | |
id: check_tag | |
shell: bash | |
run: | | |
if [ $(git tag -l "v${{ steps.determine_version.outputs.version }}") ]; then | |
echo "Existing git tag found. Exiting..." | |
echo "do_release=false" >> $GITHUB_OUTPUT | |
else | |
echo "Version bump detected - ${{ steps.determine_version.outputs.version }}" | |
echo "do_release=true" >> $GITHUB_OUTPUT | |
fi | |
create_release: | |
needs: [validate_tag] | |
runs-on: windows-latest | |
if: | | |
github.repository == 'OverlayPlugin/OverlayPlugin' && | |
needs.validate_tag.outputs.do_release == 'true' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check dependencies cache | |
id: cache-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./Thirdparty | |
./OverlayPlugin.Core/Thirdparty | |
key: ${{ runner.os }}-overlayplugin-${{ hashFiles('./tools/fetch_deps.ps1', './DEPS.json', './tools/StripFFXIVClientStructs/StripFFXIVClientStructs/StripFFXIVClientStructs.cs') }} | |
restore-keys: | | |
${{ runner.os }}-overlayplugin- | |
# Fetch dependencies only if cache-hit is false | |
- name: Fetch dependencies | |
if: steps.cache-dependencies.outputs.cache-hit != 'true' | |
shell: pwsh | |
run: | | |
.\tools\fetch_deps.ps1 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7' | |
- name: Set up msbuild | |
uses: microsoft/setup-msbuild@v1.0.2 | |
- name: Run Build | |
run: build.bat | |
shell: cmd | |
- name: Create Tag | |
shell: bash | |
run: git tag "v${{ needs.validate_tag.outputs.version }}" && git push --tags | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: OverlayPlugin ${{ needs.validate_tag.outputs.version }} | |
tag: v${{ needs.validate_tag.outputs.version }} | |
artifacts: out/OverlayPlugin-${{ needs.validate_tag.outputs.version }}.zip | |
artifactContentType: application/zip | |
generateReleaseNotes: true |