ModernUO/.github/workflows/create-release.yml
2021-02-08 00:55:06 -08:00

58 lines
1.7 KiB
YAML

name: Create Release
on:
repository_dispatch:
types: [release]
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: Install NGBV
uses: dotnet/nbgv@master
id: nbgv
- name: Get last release
id: last_release
uses: pozetroninc/github-action-get-latest-release@master
with:
owner: ModernUO
repo: ModernUO
excludes: prerelease, draft
- name: Create fake tag for diffing
run: |
git config --global user.name "Runner"
git config --global user.email "hi@modernuo.com"
git checkout ${{ steps.last_release.outputs.release }}
git tag v0.1.0 -m "Old"
git checkout -
- name: Conventional Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.github_token }}
output-file: false
skip-version-file: true
skip-commit: true
release-count: 1
- name: Delete Fake Release
uses: dev-drprasad/delete-tag-and-release@v0.1.3
with:
delete_release: true
tag_name: v${{ steps.changelog.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
with:
body: ${{ steps.changelog.outputs.clean_changelog }}
tag_name: ${{ steps.nbgv.outputs.Version }}
release_name: ${{ steps.nbgv.outputs.Version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}