Skip to content

Commit

Permalink
Reset release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamad-oddhill committed Aug 28, 2024
1 parent cd27254 commit e86a2d2
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
name: Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*'
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
Expand All @@ -14,33 +15,17 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Generate Release Notes
id: generate_notes
uses: actions/github-script@v6
with:
script: |
const { execSync } = require('child_process');
const tag = context.ref.replace('refs/tags/', '');
let previousTag;
try {
previousTag = execSync('git describe --tags --abbrev=0 ' + tag + '^').toString().trim();
} catch (error) {
previousTag = ''; // Handle the case where there is no previous tag
}
const changes = previousTag
? execSync(`git log ${previousTag}..${tag} --pretty=format:'- %s'`).toString().trim()
: execSync(`git log ${tag} --pretty=format:'- %s'`).toString().trim();
return changes;
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: ${{ steps.generate_notes.outputs.result }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: false

0 comments on commit e86a2d2

Please sign in to comment.