Create create_release.yml
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
name: Create Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
secrets:
|
||||||
|
token:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create_release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Parse Changelog Entry
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
id: changelog
|
||||||
|
uses: coditory/changelog-parser@v1 # https://github.com/coditory/changelog-parser
|
||||||
|
|
||||||
|
- name: Get last release
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
id: last_release
|
||||||
|
uses: InsonusK/get-latest-release@v1.0.1 # https://github.com/InsonusK/get-latest-release
|
||||||
|
with:
|
||||||
|
myToken: ${{ secrets.token }}
|
||||||
|
exclude_types: "draft|prerelease"
|
||||||
|
view_top: 1
|
||||||
|
|
||||||
|
- name: Changelog Version
|
||||||
|
if: ${{ github.ref == 'refs/heads/master' && ( steps.changelog.outputs.version == steps.last_release.tag_name ) }}
|
||||||
|
# fail the workflow because the versions match
|
||||||
|
run: |
|
||||||
|
echo Changelog Version: "${{ steps.changelog.outputs.version }}"
|
||||||
|
echo Last Released Version: "${{ steps.last_release.tag_name }}"
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
- name: Create/Update GitHub Release
|
||||||
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
||||||
|
uses: ncipollo/release-action@v1 # https://github.com/ncipollo/release-action
|
||||||
|
with:
|
||||||
|
name: Release ${{ steps.changelog.outputs.version }}
|
||||||
|
tag: ${{ steps.changelog.outputs.version }}
|
||||||
|
artifacts: "./artifacts/*"
|
||||||
|
token: ${{ secrets.token }}
|
||||||
|
allowUpdated: true
|
||||||
|
body: ${{ steps.changelog.outputs.description }}
|
||||||
Reference in New Issue
Block a user