Skip to content

Commit

Permalink
feat: add release.yml release
Browse files Browse the repository at this point in the history
  • Loading branch information
soblvsk committed Jul 12, 2023
1 parent 2ac62b5 commit 47788f4
Showing 1 changed file with 56 additions and 21 deletions.
77 changes: 56 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
- 'v[0-9]+'

jobs:
ci:
uses: ./.github/workflows/ci.yml
# ci:
# uses: ./.github/workflows/ci.yml

build:
needs: ci
# needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -33,24 +33,59 @@ jobs:
name: build
path: build/

# release:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# Changes in this Release
# - First Change
# - Second Change
# draft: false
# prerelease: false
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get previous tag
id: previousTag
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
fromTag: ${{ github.ref_name }}
toTag: ${{ env.previousTag }}
writeToFile: false

- name: Create Release
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
draft: true
makeLatest: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ secrets.GITHUB_TOKEN }}

# - name: '✏️ Generate release changelog'
# uses: heinrichreimer/github-changelog-generator-action@v2.3
# with:
# token: ${{ secrets.GITHUB_TOKEN }}

# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# body: |
# Changes in this Release
# - First Change
# - Second Change
# draft: false
# prerelease: false

# deploy:
# needs: release
Expand Down

0 comments on commit 47788f4

Please sign in to comment.