From 9ee5e44e1fd50fb24ae705c6414fa67388db6899 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 22:57:42 -0700 Subject: [PATCH 01/15] Updating build action to be triggered manually, and some additional cleanup and bug fixes. --- .github/workflows/build-stable.yml | 96 +++++++++++------------------- 1 file changed, 34 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index 5ee66ea8..a15d8a64 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -2,12 +2,10 @@ name: Build and publish stable branch on: workflow_dispatch: - push: - branches: [ 'main' ] - paths-ignore: - - "README.md" - - ".gitignore" - - ".editorconfig" + inputs: + tag: + required: true + description: Tag for the release that is generated. This should use semvar `like X.Y.Z` permissions: contents: write @@ -17,57 +15,9 @@ defaults: shell: bash jobs: - release_info: - name: Create release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-tags: true - # release commits should have a subject with `release X.Y.Z` in them, and - # the commit message body will be the body text of the github release. - - name: Get release version number - id: release_info - run: | - ver=$(git log -n1 --format=%s | grep -oP 'release\s+v?\K[0-9\.]+') || \ - ver=stable-$(git rev-parse --short HEAD) - echo "version=$ver" >> "$GITHUB_OUTPUT" - echo "COMMIT_BODY<> "$GITHUB_ENV" - - - name: Create draft release - uses: ncipollo/release-action@v1 - with: - tag: ${{ steps.release_info.outputs.version }} - commit: "${{ github.sha }}" - body: | - ${{ env.COMMIT_BODY }} - - # Instructions: - - - Download and extract the zip file below according to your computer - - Run the Celeste64-Fuji application from the extracted files - - # Requirements: - - - **Windows:** 10 or later, x64 - - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm - - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta - allowUpdates: true - name: "Fuji ${{ steps.release_info.outputs.version }}" - prerelease: false - makeLatest: true - draft: true - - outputs: - version: ${{ steps.release_info.outputs.version }} - build: name: Build artifacts - needs: release_info - strategy: matrix: include: @@ -105,16 +55,38 @@ jobs: run: | cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}.zip * - - name: Upload artifact to release + release: + name: Create release + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-tags: true + + - name: Create draft release uses: ncipollo/release-action@v1 with: - artifacts: Celeste64-Fuji-${{ matrix.rid }}.zip + tag: ${{ inputs.tags }} commit: "${{ github.sha }}" - tag: ${{ needs.release_info.outputs.version }} + artifacts: Celeste64-Fuji-${{ matrix.rid }}.zip + body: | + # Instructions: + + - Download and extract the zip file below according to your computer + - Run the Celeste64-Fuji application from the extracted files + + # Requirements: + + - **Windows:** 10 or later, x64 + - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm + - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta allowUpdates: true - omitNameDuringUpdate: true - omitBodyDuringUpdate: true + name: "Fuji ${{ inputs.tags }} " + prerelease: false + makeLatest: true + draft: true + + outputs: + version: ${{ inputs.tags }} - - name: Cancel release - if: ${{ failure() }} - run: gh release delete --cleanup-tag -y ${{ needs.release_info.outputs.version }} From a9927e49ad299191ff79ad5f13b90d30194ab094 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 23:03:46 -0700 Subject: [PATCH 02/15] Fixing Input Name --- .github/workflows/build-stable.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index a15d8a64..cf896a60 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -67,7 +67,7 @@ jobs: - name: Create draft release uses: ncipollo/release-action@v1 with: - tag: ${{ inputs.tags }} + tag: ${{ inputs.tag }} commit: "${{ github.sha }}" artifacts: Celeste64-Fuji-${{ matrix.rid }}.zip body: | @@ -82,11 +82,8 @@ jobs: - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta allowUpdates: true - name: "Fuji ${{ inputs.tags }} " + name: "Fuji ${{ inputs.tag }} " prerelease: false makeLatest: true draft: true - outputs: - version: ${{ inputs.tags }} - From 8954a7d60c1bac789665ea65a40a401a87128f05 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 23:16:52 -0700 Subject: [PATCH 03/15] Reworking and changing some previous workflow changes. --- .github/workflows/build-stable.yml | 70 ++++++++++++++++++------------ 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index cf896a60..b3287663 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -15,9 +15,39 @@ defaults: shell: bash jobs: - build: - name: Build artifacts + create_release: + name: Create Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-tags: true + + - name: Create draft release + uses: ncipollo/release-action@v1 + with: + tag: ${{ inputs.tag }} + commit: "${{ github.sha }}" + body: | + # Instructions: + + - Download and extract the zip file below according to your computer + - Run the Celeste64-Fuji application from the extracted files + + # Requirements: + + - **Windows:** 10 or later, x64 + - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm + - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta + allowUpdates: true + name: "Fuji ${{ inputs.tag }} " + prerelease: false + makeLatest: true + draft: true + build: + name: Build Artifacts + needs: create_release strategy: matrix: include: @@ -55,35 +85,19 @@ jobs: run: | cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}.zip * - release: - name: Create release - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-tags: true - - - name: Create draft release + - name: Upload artifact to release uses: ncipollo/release-action@v1 with: - tag: ${{ inputs.tag }} - commit: "${{ github.sha }}" artifacts: Celeste64-Fuji-${{ matrix.rid }}.zip - body: | - # Instructions: - - - Download and extract the zip file below according to your computer - - Run the Celeste64-Fuji application from the extracted files - - # Requirements: - - - **Windows:** 10 or later, x64 - - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm - - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta + commit: "${{ github.sha }}" + tag: ${{ inputs.tag }} allowUpdates: true - name: "Fuji ${{ inputs.tag }} " - prerelease: false - makeLatest: true + omitNameDuringUpdate: true + omitBodyDuringUpdate: true draft: true + - name: Cancel release + if: ${{ failure() }} + run: gh release delete --cleanup-tag -y ${{ inputs.tag }} + env: + GH_TOKEN: ${{ github.token }} \ No newline at end of file From 3dbbccf163ab7f14298a81ff2676a000c8cc78df Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 23:35:30 -0700 Subject: [PATCH 04/15] Adding check to validate tag is in a valid semvar format --- .github/workflows/build-stable.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index b3287663..40de0588 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -15,8 +15,19 @@ defaults: shell: bash jobs: + validate_inputs: + name: Validate Inputs + runs-on: ubuntu-latest + steps: + - name: Validate Tag + - run: | + if [[ "0.0.0" != ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Tag is not in a valid semvar format" + exit 1 + fi create_release: name: Create Release + needs: validate_inputs runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From e1f004ae3df9c86c7e65a507aa936aff434c076d Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 23:37:06 -0700 Subject: [PATCH 05/15] Fixing indentation --- .github/workflows/build-stable.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index 40de0588..253f1a31 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -20,11 +20,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Validate Tag - - run: | - if [[ "0.0.0" != ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Error: Tag is not in a valid semvar format" - exit 1 - fi + - run: | + if [[ "0.0.0" != ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Tag is not in a valid semvar format" + exit 1 + fi create_release: name: Create Release needs: validate_inputs From 743cab452dbbb806301417df4ae5213a4062a74e Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 23:39:07 -0700 Subject: [PATCH 06/15] Fixing yaml --- .github/workflows/build-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index 253f1a31..ef0453c6 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Validate Tag - - run: | + run: | if [[ "0.0.0" != ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Error: Tag is not in a valid semvar format" exit 1 From 8ed57d1d7ecb5919ee529b6a6f22f0bfde03549e Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 23:45:31 -0700 Subject: [PATCH 07/15] Fixing semvar logic --- .github/workflows/build-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index ef0453c6..0a4dc218 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Validate Tag run: | - if [[ "0.0.0" != ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + if [[ !({{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$) ]]; then echo "Error: Tag is not in a valid semvar format" exit 1 fi From e78acb06bc1ac4b939ac31931141f9b9d47f9403 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Wed, 1 May 2024 23:51:32 -0700 Subject: [PATCH 08/15] Adding missing character --- .github/workflows/build-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index 0a4dc218..4b3a0282 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Validate Tag run: | - if [[ !({{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$) ]]; then + if [[ !(${{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$) ]]; then echo "Error: Tag is not in a valid semvar format" exit 1 fi From ddcd5bb3ecdbe8c4a39494143bf2c92d3b688116 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Thu, 2 May 2024 00:18:21 -0700 Subject: [PATCH 09/15] Reworking beta script to work more closely to stable, and to be manually triggered --- .github/workflows/build-beta.yml | 172 ++++++++++++++--------------- .github/workflows/build-stable.yml | 2 +- 2 files changed, 83 insertions(+), 91 deletions(-) diff --git a/.github/workflows/build-beta.yml b/.github/workflows/build-beta.yml index 9e5e69ed..89015179 100644 --- a/.github/workflows/build-beta.yml +++ b/.github/workflows/build-beta.yml @@ -2,86 +2,43 @@ name: Build and publish beta branch on: workflow_dispatch: - push: - branches: [ 'beta' ] - paths-ignore: - - "README.md" - - ".gitignore" - - ".editorconfig" + inputs: + tag: + required: true + description: Tag for the release that is generated. This must follow the format of `beta-X.Y.Z-*` permissions: contents: write +defaults: + run: + shell: bash + jobs: - build: - strategy: - matrix: - include: - - platform: macos-latest - arch: x64 - - platform: macos-latest - arch: arm64 - - platform: ubuntu-latest - arch: x64 - - platform: ubuntu-latest - arch: arm64 - - platform: ubuntu-latest - arch: arm - - platform: windows-latest - arch: x64 - - runs-on: ${{ matrix.platform }} + validate_inputs: + name: Validate Inputs + runs-on: ubuntu-latest + steps: + - name: Validate Tag + run: | + if [[ !(${{ inputs.tag }} =~ ^beta\-[0-9]+\.[0-9]+\.[0-9]+\-*) ]]; then + echo "Error: Tag is formatted correctly. This should follow the format of 'beta-X.Y.Z-*'" + exit 1 + fi + create_release: + name: Create Release + needs: validate_inputs + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Fetch all tags - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Get current short hash - id: vars - run: echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> "$env:GITHUB_OUTPUT" - if: runner.os == 'Windows' - - name : Get Short Hash Linux - run: | - calculatedSha=$(git rev-parse --short ${{ github.sha }}) - echo "SHORT_SHA=$calculatedSha" >> $GITHUB_ENV - if: runner.os != 'Windows' - - name: echo short hash - run: echo "Short SHA is ${{ env.SHORT_SHA }}" - if: runner.os == 'Windows' - - name: echo short hash - run: echo "Short SHA is $SHORT_SHA" - if: runner.os != 'Windows' - - name: Setup .NET - uses: actions/setup-dotnet@v3 with: - dotnet-version: 8.0.x + fetch-tags: true - - name: Build (linux and mac) - env: - os: ${{ runner.os == 'Windows' && 'win' || runner.os == 'macOS' && 'osx' || 'linux' }} - run: | - dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r ${{env.os}}-${{ matrix.arch }} -p:ImportByWildcardBeforeSolution=false "-p:EmbeddedBuildProperty=ModVersion=${{ env.SHORT_SHA }}" -o build && cp -r Content Mods build - if: runner.os != 'Windows' - - name: Build (windows) - env: - os: ${{ runner.os == 'Windows' && 'win' || runner.os == 'macOS' && 'osx' || 'linux' }} - run: | - dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r win-${{ matrix.arch }} -p:ImportByWildcardBeforeSolution=false "-p:EmbeddedBuildProperty=ModVersion=${{steps.vars.outputs.SHORT_SHA}}" -o build && xcopy Mods build\Mods /s /e /h /i /y && xcopy Content build\Content /s /e /h /i /y - if: runner.os == 'Windows' - - name: Compress (Windows) - run: | - Compress-Archive build/* Celeste64-Fuji-${{ runner.os }}-${{ matrix.arch }}.zip - if: runner.os == 'Windows' - - - name: Compress (macOS and Linux) - run: | - cd build && zip -r ../Celeste64-Fuji-${{ runner.os }}-${{ matrix.arch }}.zip * - if: runner.os != 'Windows' - - - name: Publish Github Release Windows + - name: Create draft release uses: ncipollo/release-action@v1 with: - artifacts: Celeste64-Fuji-${{ runner.os }}-${{ matrix.arch }}.zip - tag: "beta-${{steps.vars.outputs.SHORT_SHA}}" + tag: ${{ inputs.tag }} + commit: "${{ github.sha }}" body: | # Instructions: @@ -90,35 +47,70 @@ jobs: # Requirements: - - **Windows:** 10 or later, x64 or arm - - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 - - **macOS:** Monterey or later, x64 or arm sIntel-based or Apple Silicon with Rosetta + - **Windows:** 10 or later, x64 + - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm + - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta allowUpdates: true - name: "Fuji Beta Build ${{steps.vars.outputs.SHORT_SHA}}" + name: "Fuji ${{ inputs.tag }} " prerelease: true makeLatest: false - commit: "${{ github.sha }}" - if: runner.os == 'Windows' + draft: true - - name: Publish Github Release Linux and Mac - uses: ncipollo/release-action@v1 + build: + name: Build Artifacts + needs: create_release + strategy: + matrix: + include: + - { platform: macos-latest, rid: osx-arm64 } + - { platform: macos-latest, rid: osx-x64 } + - { platform: ubuntu-latest, rid: linux-arm } + - { platform: ubuntu-latest, rid: linux-arm64 } + - { platform: ubuntu-latest, rid: linux-x64 } + - { platform: windows-latest, rid: win-x64 } + + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 with: - artifacts: Celeste64-Fuji-${{ runner.os }}-${{ matrix.arch }}.zip - tag: "beta-${{ env.SHORT_SHA }}" - body: | - # Instructions: + fetch-tags: true - - Download and extract the zip file below according to your computer - - Run the Celeste64-Fuji application from the extracted files + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x - # Requirements: + - name: Build + run: | + dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r ${{ matrix.rid }} -p:ImportByWildcardBeforeSolution=false "-p:EmbeddedBuildProperty=ModVersion=${{ inputs.tag }}" -o build + cp -r Content Mods build - - **Windows:** 10 or later, x64 - - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm - - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta + - name: Compress + if: runner.os == 'Windows' + shell: pwsh + run: | + cd build && Compress-Archive * ../Celeste64-Fuji-${{ matrix.rid }}.zip + + - name: Compress + if: runner.os != 'Windows' + run: | + cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}.zip * + + - name: Upload artifact to release + uses: ncipollo/release-action@v1 + with: + artifacts: Celeste64-Fuji-${{ matrix.rid }}.zip + commit: "${{ github.sha }}" + tag: ${{ inputs.tag }} allowUpdates: true - name: "Fuji Beta Build ${{ env.SHORT_SHA }}" + omitNameDuringUpdate: true + omitBodyDuringUpdate: true prerelease: true makeLatest: false - commit: "${{ github.sha }}" - if: runner.os != 'Windows' + draft: true + + - name: Cancel release + if: ${{ failure() }} + run: gh release delete --cleanup-tag -y ${{ inputs.tag }} + env: + GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index 4b3a0282..a741b93d 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -5,7 +5,7 @@ on: inputs: tag: required: true - description: Tag for the release that is generated. This should use semvar `like X.Y.Z` + description: Tag for the release that is generated. This must use semvar like `X.Y.Z` permissions: contents: write From 9402d0df622c74ed767f27d59c3c5b1a30c38010 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Thu, 2 May 2024 00:53:14 -0700 Subject: [PATCH 10/15] Merging beta and stable build workflows, adding better Build Version support in game --- .../{build-beta.yml => build-and-publish.yml} | 46 +++++-- .github/workflows/build-stable.yml | 114 ------------------ Celeste64.Launcher/BuildProperties.cs | 2 +- Celeste64.Launcher/Program.cs | 17 ++- 4 files changed, 46 insertions(+), 133 deletions(-) rename .github/workflows/{build-beta.yml => build-and-publish.yml} (67%) delete mode 100644 .github/workflows/build-stable.yml diff --git a/.github/workflows/build-beta.yml b/.github/workflows/build-and-publish.yml similarity index 67% rename from .github/workflows/build-beta.yml rename to .github/workflows/build-and-publish.yml index 89015179..c7dc46a7 100644 --- a/.github/workflows/build-beta.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,11 +1,27 @@ -name: Build and publish beta branch +name: Build and publish branch on: workflow_dispatch: inputs: tag: required: true - description: Tag for the release that is generated. This must follow the format of `beta-X.Y.Z-*` + description: Tag for the release that is generated. This must use semvar like `X.Y.Z` for stable branches or `beta-X.Y.Z-*` for beta branches + is-beta: + type: boolean + default: false + description: Is this a beta release? + make-latest: + type: boolean + default: true + description: Should the generated release be flagged as the latest release? + prerelease: + type: boolean + default: false + description: Should the generated release be flagged as a prerelease? + draft: + type: boolean + default: true + description: Should the generated release be flagged as a draft? permissions: contents: write @@ -19,10 +35,18 @@ jobs: name: Validate Inputs runs-on: ubuntu-latest steps: - - name: Validate Tag + - name: Validate Stable Tag + if: ${{ ! inputs.is-beta }} + run: | + if [[ !(${{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$) ]]; then + echo "Error: Tag is not in a valid semvar format. Stable releases should follow the format of 'X.Y.Z'" + exit 1 + fi + - name: Validate Beta Tag + if: ${{ inputs.is-beta }} run: | if [[ !(${{ inputs.tag }} =~ ^beta\-[0-9]+\.[0-9]+\.[0-9]+\-*) ]]; then - echo "Error: Tag is formatted correctly. This should follow the format of 'beta-X.Y.Z-*'" + echo "Error: Tag is formatted correctly. Beta releases should follow the format of 'beta-X.Y.Z-*'" exit 1 fi create_release: @@ -34,7 +58,7 @@ jobs: with: fetch-tags: true - - name: Create draft release + - name: Create release uses: ncipollo/release-action@v1 with: tag: ${{ inputs.tag }} @@ -52,9 +76,9 @@ jobs: - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta allowUpdates: true name: "Fuji ${{ inputs.tag }} " - prerelease: true - makeLatest: false - draft: true + prerelease: ${{ inputs.prerelease }} + makeLatest: ${{ inputs.make-latest }} + draft: ${{ inputs.draft }} build: name: Build Artifacts @@ -82,7 +106,7 @@ jobs: - name: Build run: | - dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r ${{ matrix.rid }} -p:ImportByWildcardBeforeSolution=false "-p:EmbeddedBuildProperty=ModVersion=${{ inputs.tag }}" -o build + dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r ${{ matrix.rid }} -p:ImportByWildcardBeforeSolution=false "-p:EmbeddedBuildProperty=BuildVersion=${{ inputs.tag }}" -o build cp -r Content Mods build - name: Compress @@ -105,9 +129,7 @@ jobs: allowUpdates: true omitNameDuringUpdate: true omitBodyDuringUpdate: true - prerelease: true - makeLatest: false - draft: true + draft: ${{ inputs.draft }} - name: Cancel release if: ${{ failure() }} diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml deleted file mode 100644 index a741b93d..00000000 --- a/.github/workflows/build-stable.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Build and publish stable branch - -on: - workflow_dispatch: - inputs: - tag: - required: true - description: Tag for the release that is generated. This must use semvar like `X.Y.Z` - -permissions: - contents: write - -defaults: - run: - shell: bash - -jobs: - validate_inputs: - name: Validate Inputs - runs-on: ubuntu-latest - steps: - - name: Validate Tag - run: | - if [[ !(${{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$) ]]; then - echo "Error: Tag is not in a valid semvar format" - exit 1 - fi - create_release: - name: Create Release - needs: validate_inputs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-tags: true - - - name: Create draft release - uses: ncipollo/release-action@v1 - with: - tag: ${{ inputs.tag }} - commit: "${{ github.sha }}" - body: | - # Instructions: - - - Download and extract the zip file below according to your computer - - Run the Celeste64-Fuji application from the extracted files - - # Requirements: - - - **Windows:** 10 or later, x64 - - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm - - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta - allowUpdates: true - name: "Fuji ${{ inputs.tag }} " - prerelease: false - makeLatest: true - draft: true - - build: - name: Build Artifacts - needs: create_release - strategy: - matrix: - include: - - { platform: macos-latest, rid: osx-arm64 } - - { platform: macos-latest, rid: osx-x64 } - - { platform: ubuntu-latest, rid: linux-arm } - - { platform: ubuntu-latest, rid: linux-arm64 } - - { platform: ubuntu-latest, rid: linux-x64 } - - { platform: windows-latest, rid: win-x64 } - - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v3 - with: - fetch-tags: true - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 8.0.x - - - name: Build - run: | - dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r ${{ matrix.rid }} -p:ImportByWildcardBeforeSolution=false -o build - cp -r Content Mods build - - - name: Compress - if: runner.os == 'Windows' - shell: pwsh - run: | - cd build && Compress-Archive * ../Celeste64-Fuji-${{ matrix.rid }}.zip - - - name: Compress - if: runner.os != 'Windows' - run: | - cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}.zip * - - - name: Upload artifact to release - uses: ncipollo/release-action@v1 - with: - artifacts: Celeste64-Fuji-${{ matrix.rid }}.zip - commit: "${{ github.sha }}" - tag: ${{ inputs.tag }} - allowUpdates: true - omitNameDuringUpdate: true - omitBodyDuringUpdate: true - draft: true - - - name: Cancel release - if: ${{ failure() }} - run: gh release delete --cleanup-tag -y ${{ inputs.tag }} - env: - GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/Celeste64.Launcher/BuildProperties.cs b/Celeste64.Launcher/BuildProperties.cs index a509f199..e8021563 100644 --- a/Celeste64.Launcher/BuildProperties.cs +++ b/Celeste64.Launcher/BuildProperties.cs @@ -5,5 +5,5 @@ namespace Celeste64.Launcher; public partial class BuildProperties { [BuildProperty] - public static partial string ModVersion(); + public static partial string BuildVersion(); } diff --git a/Celeste64.Launcher/Program.cs b/Celeste64.Launcher/Program.cs index 78500c31..d5209ef5 100644 --- a/Celeste64.Launcher/Program.cs +++ b/Celeste64.Launcher/Program.cs @@ -16,14 +16,19 @@ public static void Main(string[] args) { ConsoleHelper.CreateConsole(); } - Version loaderVersion = typeof(Program).Assembly.GetName().Version!; - Game.LoaderVersion = $"Fuji: v.{loaderVersion.Major}.{loaderVersion.Minor}.{loaderVersion.Build}"; - Game.IsDynamicRes = parsedArgs.Has("dynamic-res"); - Game.AppArgs = parsedArgs; // Expose our parsed args to the game - if (!string.IsNullOrEmpty(BuildProperties.ModVersion())) + if (!string.IsNullOrEmpty(BuildProperties.BuildVersion())) + { + Game.LoaderVersion = $"Fuji: v.{BuildProperties.BuildVersion()}"; + } + else { - Game.LoaderVersion += "-" + BuildProperties.ModVersion(); + Version loaderVersion = typeof(Program).Assembly.GetName().Version!; + Game.LoaderVersion = $"Fuji: v.{loaderVersion.Major}.{loaderVersion.Minor}.{loaderVersion.Build}"; } + + Game.IsDynamicRes = parsedArgs.Has("dynamic-res"); + Game.AppArgs = parsedArgs; // Expose our parsed args to the game + Log.Info($"Celeste 64 v.{Game.GameVersion.Major}.{Game.GameVersion.Minor}.{Game.GameVersion.Build}"); Log.Info(Game.LoaderVersion); From 40a6354b7a6e7608052c40c0abba059b6d3a186d Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Thu, 2 May 2024 01:00:17 -0700 Subject: [PATCH 11/15] temporarily renaming back to stable to test before merging --- .github/workflows/{build-and-publish.yml => build-stable.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-and-publish.yml => build-stable.yml} (100%) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-stable.yml similarity index 100% rename from .github/workflows/build-and-publish.yml rename to .github/workflows/build-stable.yml From b342996237e7d6255cb620f04d93da90c9749c7f Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Thu, 2 May 2024 01:07:30 -0700 Subject: [PATCH 12/15] Updating to include version in generated zip names --- .github/workflows/build-and-publish.yml | 138 ++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 .github/workflows/build-and-publish.yml diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml new file mode 100644 index 00000000..07963849 --- /dev/null +++ b/.github/workflows/build-and-publish.yml @@ -0,0 +1,138 @@ +name: Build and publish branch + +on: + workflow_dispatch: + inputs: + tag: + required: true + description: Tag for the release that is generated. This must use semvar like `X.Y.Z` for stable branches or `beta-X.Y.Z-*` for beta branches + is-beta: + type: boolean + default: false + description: Is this a beta release? + make-latest: + type: boolean + default: true + description: Should the generated release be flagged as the latest release? + prerelease: + type: boolean + default: false + description: Should the generated release be flagged as a prerelease? + draft: + type: boolean + default: true + description: Should the generated release be flagged as a draft? + +permissions: + contents: write + +defaults: + run: + shell: bash + +jobs: + validate_inputs: + name: Validate Inputs + runs-on: ubuntu-latest + steps: + - name: Validate Stable Tag + if: ${{ ! inputs.is-beta }} + run: | + if [[ !(${{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$) ]]; then + echo "Error: Tag is not in a valid semvar format. Stable releases should follow the format of 'X.Y.Z'" + exit 1 + fi + - name: Validate Beta Tag + if: ${{ inputs.is-beta }} + run: | + if [[ !(${{ inputs.tag }} =~ ^beta\-[0-9]+\.[0-9]+\.[0-9]+\-*) ]]; then + echo "Error: Tag is formatted correctly. Beta releases should follow the format of 'beta-X.Y.Z-*'" + exit 1 + fi + create_release: + name: Create Release + needs: validate_inputs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-tags: true + + - name: Create release + uses: ncipollo/release-action@v1 + with: + tag: ${{ inputs.tag }} + commit: "${{ github.sha }}" + body: | + # Instructions: + + - Download and extract the zip file below according to your computer + - Run the Celeste64-Fuji application from the extracted files + + # Requirements: + + - **Windows:** 10 or later, x64 + - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm + - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta + allowUpdates: true + name: "Fuji ${{ inputs.tag }} " + prerelease: ${{ inputs.prerelease }} + makeLatest: ${{ inputs.make-latest }} + draft: ${{ inputs.draft }} + + build: + name: Build Artifacts + needs: create_release + strategy: + matrix: + include: + - { platform: macos-latest, rid: osx-arm64 } + - { platform: macos-latest, rid: osx-x64 } + - { platform: ubuntu-latest, rid: linux-arm } + - { platform: ubuntu-latest, rid: linux-arm64 } + - { platform: ubuntu-latest, rid: linux-x64 } + - { platform: windows-latest, rid: win-x64 } + + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + with: + fetch-tags: true + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + + - name: Build + run: | + dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r ${{ matrix.rid }} -p:ImportByWildcardBeforeSolution=false "-p:EmbeddedBuildProperty=BuildVersion=${{ inputs.tag }}" -o build + cp -r Content Mods build + + - name: Compress + if: runner.os == 'Windows' + shell: pwsh + run: | + cd build && Compress-Archive * ../Celeste64-Fuji-${{ matrix.rid }}.zip + + - name: Compress + if: runner.os != 'Windows' + run: | + cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}-${{ inputs.tag }}.zip * + + - name: Upload artifact to release + uses: ncipollo/release-action@v1 + with: + artifacts: Celeste64-Fuji-${{ matrix.rid }}-${{ inputs.tag }}.zip + commit: "${{ github.sha }}" + tag: ${{ inputs.tag }} + allowUpdates: true + omitNameDuringUpdate: true + omitBodyDuringUpdate: true + draft: ${{ inputs.draft }} + + - name: Cancel release + if: ${{ failure() }}s + run: gh release delete --cleanup-tag -y ${{ inputs.tag }} + env: + GH_TOKEN: ${{ github.token }} \ No newline at end of file From a5d8904819f86a7d4f36ddfe57afa715e2bd6295 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Thu, 2 May 2024 01:14:16 -0700 Subject: [PATCH 13/15] fixing yml scripts for testing --- .github/workflows/build-and-publish.yml | 138 ------------------------ .github/workflows/build-stable.yml | 4 +- 2 files changed, 2 insertions(+), 140 deletions(-) delete mode 100644 .github/workflows/build-and-publish.yml diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml deleted file mode 100644 index 07963849..00000000 --- a/.github/workflows/build-and-publish.yml +++ /dev/null @@ -1,138 +0,0 @@ -name: Build and publish branch - -on: - workflow_dispatch: - inputs: - tag: - required: true - description: Tag for the release that is generated. This must use semvar like `X.Y.Z` for stable branches or `beta-X.Y.Z-*` for beta branches - is-beta: - type: boolean - default: false - description: Is this a beta release? - make-latest: - type: boolean - default: true - description: Should the generated release be flagged as the latest release? - prerelease: - type: boolean - default: false - description: Should the generated release be flagged as a prerelease? - draft: - type: boolean - default: true - description: Should the generated release be flagged as a draft? - -permissions: - contents: write - -defaults: - run: - shell: bash - -jobs: - validate_inputs: - name: Validate Inputs - runs-on: ubuntu-latest - steps: - - name: Validate Stable Tag - if: ${{ ! inputs.is-beta }} - run: | - if [[ !(${{ inputs.tag }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$) ]]; then - echo "Error: Tag is not in a valid semvar format. Stable releases should follow the format of 'X.Y.Z'" - exit 1 - fi - - name: Validate Beta Tag - if: ${{ inputs.is-beta }} - run: | - if [[ !(${{ inputs.tag }} =~ ^beta\-[0-9]+\.[0-9]+\.[0-9]+\-*) ]]; then - echo "Error: Tag is formatted correctly. Beta releases should follow the format of 'beta-X.Y.Z-*'" - exit 1 - fi - create_release: - name: Create Release - needs: validate_inputs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-tags: true - - - name: Create release - uses: ncipollo/release-action@v1 - with: - tag: ${{ inputs.tag }} - commit: "${{ github.sha }}" - body: | - # Instructions: - - - Download and extract the zip file below according to your computer - - Run the Celeste64-Fuji application from the extracted files - - # Requirements: - - - **Windows:** 10 or later, x64 - - **Linux:** [Distro support list](https://github.com/dotnet/core/blob/main/release-notes/8.0/supported-os.md), x64 or arm - - **macOS:** Monterey or later, x64 or arm Intel-based or Apple Silicon with Rosetta - allowUpdates: true - name: "Fuji ${{ inputs.tag }} " - prerelease: ${{ inputs.prerelease }} - makeLatest: ${{ inputs.make-latest }} - draft: ${{ inputs.draft }} - - build: - name: Build Artifacts - needs: create_release - strategy: - matrix: - include: - - { platform: macos-latest, rid: osx-arm64 } - - { platform: macos-latest, rid: osx-x64 } - - { platform: ubuntu-latest, rid: linux-arm } - - { platform: ubuntu-latest, rid: linux-arm64 } - - { platform: ubuntu-latest, rid: linux-x64 } - - { platform: windows-latest, rid: win-x64 } - - runs-on: ${{ matrix.platform }} - steps: - - uses: actions/checkout@v3 - with: - fetch-tags: true - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 8.0.x - - - name: Build - run: | - dotnet publish Celeste64.Launcher/Celeste64.Launcher.csproj -c Release -r ${{ matrix.rid }} -p:ImportByWildcardBeforeSolution=false "-p:EmbeddedBuildProperty=BuildVersion=${{ inputs.tag }}" -o build - cp -r Content Mods build - - - name: Compress - if: runner.os == 'Windows' - shell: pwsh - run: | - cd build && Compress-Archive * ../Celeste64-Fuji-${{ matrix.rid }}.zip - - - name: Compress - if: runner.os != 'Windows' - run: | - cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}-${{ inputs.tag }}.zip * - - - name: Upload artifact to release - uses: ncipollo/release-action@v1 - with: - artifacts: Celeste64-Fuji-${{ matrix.rid }}-${{ inputs.tag }}.zip - commit: "${{ github.sha }}" - tag: ${{ inputs.tag }} - allowUpdates: true - omitNameDuringUpdate: true - omitBodyDuringUpdate: true - draft: ${{ inputs.draft }} - - - name: Cancel release - if: ${{ failure() }}s - run: gh release delete --cleanup-tag -y ${{ inputs.tag }} - env: - GH_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index c7dc46a7..578b2b48 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -118,12 +118,12 @@ jobs: - name: Compress if: runner.os != 'Windows' run: | - cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}.zip * + cd build && zip -r ../Celeste64-Fuji-${{ matrix.rid }}-${{ inputs.tag }}.zip * - name: Upload artifact to release uses: ncipollo/release-action@v1 with: - artifacts: Celeste64-Fuji-${{ matrix.rid }}.zip + artifacts: Celeste64-Fuji-${{ matrix.rid }}-${{ inputs.tag }}.zip commit: "${{ github.sha }}" tag: ${{ inputs.tag }} allowUpdates: true From 88cd2181444e86bca6fcbf58a7f9964cd7133e55 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Thu, 2 May 2024 01:20:14 -0700 Subject: [PATCH 14/15] Fixing windows zip name --- .github/workflows/build-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-stable.yml index 578b2b48..e6f63590 100644 --- a/.github/workflows/build-stable.yml +++ b/.github/workflows/build-stable.yml @@ -113,7 +113,7 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | - cd build && Compress-Archive * ../Celeste64-Fuji-${{ matrix.rid }}.zip + cd build && Compress-Archive * ../Celeste64-Fuji-${{ matrix.rid }}-${{ inputs.tag }}.zip - name: Compress if: runner.os != 'Windows' From 88cd57f57abb125a6cd7d04c7c73084edcf83546 Mon Sep 17 00:00:00 2001 From: Jasmine Stephens Date: Mon, 13 May 2024 22:05:05 -0700 Subject: [PATCH 15/15] renaming build and publish workflow --- .github/workflows/{build-stable.yml => build-and-publish.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{build-stable.yml => build-and-publish.yml} (100%) diff --git a/.github/workflows/build-stable.yml b/.github/workflows/build-and-publish.yml similarity index 100% rename from .github/workflows/build-stable.yml rename to .github/workflows/build-and-publish.yml