The Github workflow's step for verifying commits' existence has been updated. Instead of searching in the 'origin/main' branch, the workflow now checks in the 'origin/v3.0.1' branch. This modification ensures compatibility and consistency with the version being used.
91 lines
3.1 KiB
YAML
91 lines
3.1 KiB
YAML
name: Elsa 3 Packages
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- v3.0.1
|
|
release:
|
|
types: [ prereleased, published ]
|
|
env:
|
|
feedz_feed_source: 'https://f.feedz.io/elsa-workflows/elsa-3/nuget/index.json'
|
|
nuget_feed_source: 'https://api.nuget.org/v3/index.json'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build packages
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Verify commit exists in origin/v3.0.1
|
|
run: |
|
|
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
|
git branch --remote --contains | grep origin/v3.0.1
|
|
- name: Set VERSION variable
|
|
run: |
|
|
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "published" ]]; then
|
|
TAG_NAME=${{ github.ref }} # e.g., refs/tags/3.0.0
|
|
TAG_NAME=${TAG_NAME#refs/tags/} # remove the refs/tags/ prefix
|
|
echo "VERSION=${TAG_NAME}" >> $GITHUB_ENV
|
|
else
|
|
echo "VERSION=3.0.1-preview.${{github.run_number}}" >> $GITHUB_ENV
|
|
fi
|
|
- 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} /p:PackageOutputPath=$(pwd)/packages
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: elsa-nuget-packages
|
|
path: packages/*nupkg
|
|
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
|
|
|
|
publish_preview_feedz:
|
|
name: Publish to feedz.io
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
|
|
steps:
|
|
- name: Download Packages
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: elsa-nuget-packages
|
|
|
|
- name: Publish to feedz.io
|
|
run: dotnet nuget push *.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s ${{ env.feedz_feed_source }} --skip-duplicate
|
|
|
|
publish_preview_nuget:
|
|
name: Publish preview to nuget.org
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
if: ${{ github.event_name == 'prereleased' && github.event.action == 'published' }}
|
|
steps:
|
|
- name: Download Packages
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: elsa-nuget-packages
|
|
|
|
- name: Publish to nuget.org
|
|
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.nuget_feed_source }} --skip-duplicate
|
|
|
|
publish_nuget:
|
|
name: Publish release to nuget.org
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
|
steps:
|
|
- name: Download Packages
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: elsa-nuget-packages
|
|
|
|
- name: Publish to nuget.org
|
|
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.nuget_feed_source }} --skip-duplicate
|