From 09d4dbd5a4f1ac642435071f31e809303511eb38 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 9 Nov 2022 13:53:04 +0100 Subject: [PATCH] Add GitHub actions --- .github/workflows/ci.yml | 18 ++++++++++++++++++ .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ Elsa.sln | 3 +++ 3 files changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..99640cc2e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +on: + push: + branches: + - v3 + pull_request: + branches: + - v3 +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build + run: dotnet build --configuration Release + - name: Test + run: dotnet test --configuration Release --no-build \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..3cf3d860d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Verify commit exists in origin/v3 + run: | + git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + git branch --remote --contains | grep origin/v3 + - name: Set VERSION variable from tag + run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV + - name: Build + run: dotnet build --configuration Release /p:Version=${VERSION} + - name: Test + run: dotnet test --configuration Release /p:Version=${VERSION} --no-build + - name: Pack + run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output . + - name: Authenticate + run: dotnet nuget add source --username sfmskywalker --password ${{ GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/elsa-core/index.json" + - name: Push + run: dotnet nuget push "*/**/*.nupkg" --api-key ${GITHUB_TOKEN} --source "github" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/Elsa.sln b/Elsa.sln index bb77fd04d..5447cec14 100644 --- a/Elsa.sln +++ b/Elsa.sln @@ -14,6 +14,9 @@ ProjectSection(SolutionItems) = preProject docker-compose.yml = docker-compose.yml common.props = common.props configureawait.props = configureawait.props + .github\workflows\ci.yml = .github\workflows\ci.yml + .github\workflows\release.yml = .github\workflows\release.yml + .gitignore = .gitignore EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{0354F050-3992-4DD4-B0EE-5FBA04AC72B6}"