diff --git a/.github/changelog-configuration.json b/.github/changelog-configuration.json new file mode 100644 index 000000000..4cd4a5988 --- /dev/null +++ b/.github/changelog-configuration.json @@ -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}}" +} diff --git a/.github/workflows/build_release.yaml b/.github/workflows/build_release.yaml new file mode 100644 index 000000000..22cb10cf6 --- /dev/null +++ b/.github/workflows/build_release.yaml @@ -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/release-changelog-builder-action@v4.1.1 + with: + toTag: "release-${{ inputs.version }}" + configuration: ".github/changelog-configuration.json" + failOnError: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Draft Release + uses: softprops/action-gh-release@v0.1.15 + 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 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index baea7ae24..f408faa2d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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-*' @@ -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 +