From aecad7e04c1c48281cb2aeb76aa2fa2718a06cfb Mon Sep 17 00:00:00 2001 From: alterNERDtive Date: Sun, 18 Feb 2024 23:51:12 +0100 Subject: [PATCH] chore: forgejo workflows --- .forgejo/workflows/create-release.yaml | 64 +++++++++++++++++++ .../workflows/push-test.yaml | 0 .github/workflows/auto-pull-request.yaml | 20 ------ .github/workflows/create-release.yaml | 4 +- 4 files changed, 66 insertions(+), 22 deletions(-) create mode 100644 .forgejo/workflows/create-release.yaml rename {.github => .forgejo}/workflows/push-test.yaml (100%) delete mode 100644 .github/workflows/auto-pull-request.yaml diff --git a/.forgejo/workflows/create-release.yaml b/.forgejo/workflows/create-release.yaml new file mode 100644 index 0000000..8d1bcfc --- /dev/null +++ b/.forgejo/workflows/create-release.yaml @@ -0,0 +1,64 @@ +name: Create release on tag push + +on: + push: + tags: + - 'release/*' + +jobs: + build: + name: Create release + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Install VoiceAttack + uses: alterNERDtive/setup-voiceattack-action@develop + with: + version: "1.10" + + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Setup .Net + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '7.0.x' + + - name: Restore dependencies + run: dotnet restore + + - name: Build + run: dotnet build -c release + + - name: Run tests + run: dotnet test + + - name: Create NuGet package + run: dotnet pack -c release "VoiceAttack-Framework/VoiceAttack-Framework.csproj" + + - name: Push NuGet package + run: dotnet nuget push "VoiceAttack-Framework/bin/Release/alterNERDtive.YAVAPF.*.nupkg" --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_AUTH_TOKEN}} + + - name: Get release body + run: | + echo "release_body=$(cat CHANGELOG.md)" >> "$GITHUB_ENV" + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: '>=1.20.1' + + - name: Draft release + uses: https://gitea.com/actions/release-action@main + with: + body: ${{ env.release_body }} + files: |- + VoiceAttack-Framework/bin/Release/alterNERDtive.YAVAPF.*nupkg + VoiceAttack-Framework/bin/Release/net48/VoiceAttack-Framework.* + draft: true + api_key: '${{ secrets.RELEASE_TOKEN }}' diff --git a/.github/workflows/push-test.yaml b/.forgejo/workflows/push-test.yaml similarity index 100% rename from .github/workflows/push-test.yaml rename to .forgejo/workflows/push-test.yaml diff --git a/.github/workflows/auto-pull-request.yaml b/.github/workflows/auto-pull-request.yaml deleted file mode 100644 index 4d0171a..0000000 --- a/.github/workflows/auto-pull-request.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: Pull Request on Branch Push - -on: - push: - branches-ignore: - - develop - - release - -jobs: - auto-pull-request: - name: Open pull request - runs-on: ubuntu-latest - steps: - - name: pull-request-action - uses: vsoch/pull-request-action@1.0.24 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PULL_REQUEST_BRANCH: "develop" - PULL_REQUEST_DRAFT: true - PASS_IF_EXISTS: true diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 530b8b0..5f279e5 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -19,12 +19,12 @@ jobs: version: "1.10" - name: Checkout source code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup .Net uses: actions/setup-dotnet@v2 with: - dotnet-version: '6.0.x' + dotnet-version: '7.0.x' - name: Restore dependencies run: dotnet restore