Version 1.3.4 #18
Workflow file for this run
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: Release Build | |
on: | |
release: | |
types: | |
- published | |
permissions: | |
contents: write | |
jobs: | |
update-version: | |
name: Update Version File | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Update version.txt | |
run: | | |
echo "${{ github.event.release.tag_name }}" > version.txt | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
git add version.txt | |
git commit -m "Update version.txt for release ${{ github.event.release.tag_name }}" | |
git push origin HEAD:main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
needs: update-version | |
name: Build and Attach Release Assets | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
architecture: x64 | |
runtime: win-x64 | |
suffix: win-x64 | |
- os: windows-latest | |
architecture: x86 | |
runtime: win-x86 | |
suffix: win-x86 | |
- os: ubuntu-latest | |
architecture: x64 | |
runtime: linux-x64 | |
suffix: linux-x64 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Restore dependencies | |
run: dotnet restore src/UnrealLocresEditor.Desktop | |
- name: Build | |
run: dotnet publish src/UnrealLocresEditor.Desktop --runtime ${{ matrix.runtime }} -c Release --self-contained true -p:PublishSingleFile=true --p:PublishTrimmed=true --output ./output/${{ matrix.runtime }} | |
- name: Create version.txt for artifacts | |
shell: bash | |
run: echo "${{ github.event.release.tag_name }}" > ./output/${{ matrix.runtime }}/version.txt | |
- name: Create artifacts directory | |
run: mkdir -p artifacts | |
- name: Create ZIP Archive | |
shell: bash | |
run: | | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
powershell -Command "Compress-Archive -Path ./output/${{ matrix.runtime }}/* -DestinationPath ./artifacts/UnrealLocresEditor-${{ github.event.release.tag_name }}-${{ matrix.suffix }}.zip" | |
else | |
cd output/${{ matrix.runtime }} && zip -r ../../artifacts/UnrealLocresEditor-${{ github.event.release.tag_name }}-${{ matrix.suffix }}.zip ./* | |
fi | |
- name: Upload Build Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.suffix }} | |
path: artifacts/UnrealLocresEditor-${{ github.event.release.tag_name }}-${{ matrix.suffix }}.zip | |
attach-assets: | |
name: Attach Build Artifacts to Release | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ./artifacts | |
- name: Upload Release Assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./artifacts/**/*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |