Skip to content

chore(release): prepare v1.7.2 #23

chore(release): prepare v1.7.2

chore(release): prepare v1.7.2 #23

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
- name: Extract version from tag
id: version
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/v}"
echo "version=$TAG" >> "$GITHUB_OUTPUT"
echo "Building version: $TAG"
- name: Publish
run: >
dotnet publish ReScene.NET/ReScene.NET.csproj
-c Release
-r win-x64
--self-contained
-p:Version=${{ steps.version.outputs.version }}
-p:PublishSingleFile=true
-p:IncludeNativeLibrariesForSelfExtract=true
-o publish
- name: Create zip
shell: pwsh
run: Compress-Archive -Path publish/* -DestinationPath ReScene.NET-${{ steps.version.outputs.version }}-win-x64.zip
- name: Check whether ReScene.Lib should be released
id: libcheck
shell: bash
run: |
LIB_VERSION=$(sed -n 's@.*<Version>\(.*\)</Version>.*@\1@p' ReScene.Lib/ReScene/ReScene.csproj | head -1)
TAG_VERSION="${{ steps.version.outputs.version }}"
echo "ReScene.Lib csproj version: $LIB_VERSION | tag version: $TAG_VERSION"
if [ "$LIB_VERSION" = "$TAG_VERSION" ]; then
echo "release=true" >> "$GITHUB_OUTPUT"
echo "ReScene.Lib will be released (csproj matches the tag)."
else
echo "release=false" >> "$GITHUB_OUTPUT"
echo "Skipping ReScene.Lib release (csproj $LIB_VERSION does not match tag $TAG_VERSION)."
fi
- name: Tag ReScene.Lib submodule
if: env.LIB_PAT != '' && steps.libcheck.outputs.release == 'true'
shell: bash
env:
LIB_PAT: ${{ secrets.LIB_PAT }}
run: |
cd ReScene.Lib
SUBMODULE_SHA=$(git rev-parse HEAD)
TAG="v${{ steps.version.outputs.version }}"
echo "Tagging ReScene.Lib commit $SUBMODULE_SHA as $TAG"
git config --unset-all http.https://github.com/.extraheader || true
git tag "$TAG" "$SUBMODULE_SHA"
git remote set-url origin "https://x-access-token:${LIB_PAT}@github.com/NeWbY100/ReScene.Lib.git"
git push origin "$TAG"
- name: Create ReScene.Lib GitHub Release
if: env.LIB_PAT != '' && steps.libcheck.outputs.release == 'true'
shell: bash
env:
LIB_PAT: ${{ secrets.LIB_PAT }}
GH_TOKEN: ${{ secrets.LIB_PAT }}
run: |
TAG="v${{ steps.version.outputs.version }}"
gh release create "$TAG" \
--repo NeWbY100/ReScene.Lib \
--title "$TAG" \
--generate-notes
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: ReScene.NET-${{ steps.version.outputs.version }}-win-x64.zip