From 8a20f74f9b1e607b2a2823245b1466bd1e6ad0dd Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Tue, 14 May 2024 15:21:20 -0700 Subject: [PATCH] Create release.yml --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cf4943a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release new version + +on: + push: + tags: + - v* + +jobs: + publish-nuget: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: true + - name: Get version from tag + id: get-version + uses: battila7/get-version-action@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Set AssemblyInfo version + uses: dannevesdantas/set-version-assemblyinfo@v.1.0.0 + with: + path: ${{ github.workspace }}/Moffat.EndlessOnline.SDK/Properties + version: ${{ steps.get-version.outputs.version-without-v }} + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build -c Release --no-restore + - name: Pack NuGet package + run: dotnet pack Moffat.EndlessOnline.SDK/Moffat.EndlessOnline.SDK.csproj -c Release --no-build --no-restore -p:PackageVersion=${{ steps.get-version.outputs.version-without-v }} -o ${{ github.workspace }}/pkgs + - name: Upload build artifact + uses: actions/upload-artifact@v4.3.3 + with: + name: pkg + path: ${{ github.workspace }}/pkgs/*.nupkg + + github-release: + if: false + needs: publish-nuget + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get version from tag + id: get-version + uses: battila7/get-version-action@v2 + - name: Parse Changelog + id: changelog + uses: coditory/changelog-parser@v1 + with: + version: ${{ steps.get-version.outputs.version-without-v }} + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + name: Moffat.EndlessOnline.SDK v${{ steps.changelog.outputs.version }} + body: ${{ steps.changelog.outputs.description }}