Skip to content

Create new workflow for automating the release process #199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/changelog-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"categories": [
{
"title": "## What's Added",
"labels": ["feat"],
},
{
"title": "## What's Fixed",
"labels": ["fix"],
},
{
"title": "## What's Updated",
"labels": ["update"],
},
{
"title": "## Uncategorized",
"labels": [],
},
],
"template": "#{{CHANGELOG}}",
"pr_template": "* #{{TITLE}} by @#{{AUTHOR}} in ##{{NUMBER}}"
}
49 changes: 49 additions & 0 deletions .github/workflows/build_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
on:
workflow_dispatch:
inputs:
version:
description: "Release version (e.g., 1.1.0)"
required: true
type: string

name: Build Release

jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get current date
id: date
run: |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

- name: Build Assets
run: git ls-files | zip LME-${{ inputs.version }}.zip -@

- name: Build Changelog
id: release
uses: mikepenz/[email protected]
with:
toTag: "release-${{ inputs.version }}"
configuration: ".github/changelog-configuration.json"
failOnError: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Draft Release
uses: softprops/[email protected]
with:
name: LME v${{ inputs.version }}
tag_name: v${{ inputs.version }}
body: |
## [${{ inputs.version }}] - Timberrrrr! - ${{ env.date }}
${{ steps.release.outputs.changelog }}
files: LME-${{ inputs.version }}.zip
draft: true
prerelease: false
discussion_category_name: "Announcements"
generate_release_notes: false
fail_on_unmatched_files: true
27 changes: 3 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*' # match basic semver tags
pull_request:
branches:
pull_request:
branches:
- main
- 'release-*'

Expand Down Expand Up @@ -62,25 +62,4 @@ jobs:
run: |
semgrep --config "p/r2c" .

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [lint, semgrep-scan]
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0

- name: Set up tag name
id: tag
run: echo "::set-output name=tag::${GITHUB_REF##*/}"

- name: Build
run: git ls-files | zip release-${{ steps.tag.outputs.tag }}.zip -@

- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
with:
files: release-${{ steps.tag.outputs.tag }}.zip
draft: true
generate_release_notes: true
fail_on_unmatched_files: true