From e6715e9f6bd91c31df32fae06239fc0fea013e8b Mon Sep 17 00:00:00 2001 From: Jason Best Date: Wed, 31 Jan 2024 13:51:45 -0500 Subject: [PATCH] Move release/dev to a separate workflow --- .github/workflows/compile.yml | 27 ++++++++++++--------------- .github/workflows/dev.yml | 11 +++++++++++ .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/dev.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 471b459..f2c2c52 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -1,10 +1,7 @@ name: SData client library build on: - push: - branches: [ "master", "develop" ] - pull_request: - branches: [ "master", "develop" ] + workflow_call: jobs: build: @@ -28,16 +25,16 @@ jobs: run: | .\Build.ps1 -Debug $false - # TODO: Don't use a fixed version here - # TODO: Move to a different workflow - We don't want a nuget package for every push to master/develop - - name: nuspec - shell: pwsh - run: | - nuget pack .\DotNetSDataClient.nuspec -properties version=2.1 -OutputDirectory dist\nuget - - - name: store artifacts - uses: actions/upload-artifact@v2 + - name: store release artifacts + uses: actions/upload-artifact@v4 with: - name: nuget - path: dist\nuget + name: release + path: dist\Release + if-no-files-found: error + - name: store debug artifacts + uses: actions/upload-artifact@v4 + with: + name: debug + path: dist\Debug + if-no-files-found: error diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..bbd7494 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,11 @@ +name: release build + +on: + push: + branches: ['master', 'develop'] + pull_request: + branches: ['master', 'develop'] + +jobs: + build_job: + uses: ./github/workflows/compile.yml \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e22db9b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +name: release build + +on: + push: + tags: + - '**' + +jobs: + build_job: + uses: ./github/workflows/compile.yml + nuget_job: + needs: build_job + runs-on: windows-2019 + steps: + - name: Setup NuGet + uses: nuget/setup-nuget@v1 + - name: download release + uses: actions/download-artifact@v4 + with: + name: release + path: dist\release + - name: nuspec pack + shell: pwsh + run: | + nuget pack .\DotNetSDataClient.nuspec -properties version=${{ env.GITHUB_REF_NAME }} -OutputDirectory dist\nuget + - name: store artifacts + uses: actions/upload-artifact@v4 + with: + name: nuget + path: dist\nuget