name: Create Release on: repository_dispatch: types: [release] workflow_dispatch: jobs: release: name: Create Release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # avoid shallow clone so nbgv can do its work. token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Setup .NET 8 uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Install NGBV uses: dotnet/nbgv@master id: nbgv - name: Get Latest Release id: last_release uses: pozetroninc/github-action-get-latest-release@master with: owner: ModernUO repo: ModernUO excludes: prerelease, draft token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Create fake tag for diffing run: | git config --global user.name "Fake Tag Action" git config --global user.email "hi@modernuo.com" git checkout ${{ steps.last_release.outputs.release }} git tag -fa v0.1.0 -m "Fake release" git checkout - - name: Push git changes uses: ad-m/github-push-action@master with: github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} tags: true - name: Pin Conventional Changelog Commits Dependency run: | npm i conventional-changelog-conventionalcommits@v7.0.2 - name: Conventional Changelog id: changelog uses: TriPSs/conventional-changelog-action@v5.3.0 with: github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} output-file: false skip-version-file: true skip-commit: true release-count: 1 - name: Delete v${{ steps.changelog.outputs.version }} Tag uses: dev-drprasad/delete-tag-and-release@v1.1 with: delete_release: true tag_name: v${{ steps.changelog.outputs.version }} github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Delete v0.1.0 Tag uses: dev-drprasad/delete-tag-and-release@v1.1 with: delete_release: true tag_name: v0.1.0 github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - name: Create Release id: create_release uses: softprops/action-gh-release@v2 with: body: ${{ steps.changelog.outputs.clean_changelog }} tag_name: ${{ steps.nbgv.outputs.Version }} name: ${{ steps.nbgv.outputs.Version }} draft: false prerelease: false token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}