Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing actions #258

Closed
wants to merge 14 commits into from
47 changes: 44 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,49 @@ jobs:
id: setup-build
run: echo "build-suffix=${{ github.event_name == 'push' && env.CiRunPushSuffix || github.event_name == 'pull_request' && env.CiRunPullSuffix || null }}" >> "$GITHUB_OUTPUT"

check-semver:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout current version
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Find previous release
id: previous-release
env:
GH_TOKEN: ${{ github.token }}
run: echo "RELEASE_NAME=$(gh release list -L 1 --json tagName -q .[0].tagName)" >> $GITHUB_OUTPUT

- name: Checkout last release version
if: success()
uses: actions/checkout@v4
with:
ref: ${{ steps.previous-release.outputs.RELEASE_NAME }}
path: last-release
sparse-checkout: |
Directory.Build.props
sparse-checkout-cone-mode: false

- name: Verify
if: success()
run: |
echo "Current: $(cat ./Directory.Build.props | grep -Po '(?<=VersionPrefix>).*(?=</VersionPrefix>)')"
echo "Release: $(cat ./last-release/Directory.Build.props | grep -Po '(?<=VersionPrefix>).*(?=</VersionPrefix>)')"

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

- name: Install semver
shell: pwsh
run: Install-Package semver

build:
needs: [setup]
needs: [setup, check-semver]
if: false
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -70,8 +111,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
packages: write
needs: [build]
if: github.event_name == 'push' || github.event_name == 'release'
needs: [build, check-semver]
if: github.event_name == 'push' || github.event_name == 'release' && false
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
Expand Down
Loading