Skip to content
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
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# RaidLogAuto Code Owners
# These users will be automatically requested for review on PRs

* @Xerrion
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: Xerrion
ko_fi: Xerrion
50 changes: 7 additions & 43 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,14 @@
name: Release PR

on:
push:
branches:
- master
paths-ignore:
- CHANGELOG.md
push:
branches: [master]

permissions:
contents: write
pull-requests: write
contents: write
pull-requests: write

jobs:
release-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Generate changelog
id: git-cliff
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --bump --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Normalize version
id: version
if: steps.git-cliff.outputs.version
run: |
VERSION="${{ steps.git-cliff.outputs.version }}"
VERSION="${VERSION#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Create/update release PR
if: steps.version.outputs.version
uses: peter-evans/create-pull-request@v7
with:
branch: release/next
title: "chore: release ${{ steps.version.outputs.version }}"
labels: autorelease
commit-message: "chore: release ${{ steps.version.outputs.version }}"
body: "Automated release PR for version ${{ steps.version.outputs.version }}"
delete-branch: true
release-pr:
uses: DragonAddons/wow-workflows/.github/workflows/release-pr.yml@main
secrets: inherit
158 changes: 13 additions & 145 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,153 +1,21 @@
name: Release

on:
push:
tags:
- "*"
pull_request:
types: [closed]
branches:
- master
workflow_dispatch:
inputs:
tag_name:
description: "Tag to package (e.g. 1.1.2)"
required: true
type: string
push:
tags:
- "*"
workflow_dispatch:
inputs:
tag_name:
description: Tag to release
required: true

permissions:
contents: write
pull-requests: read
contents: write

jobs:
create-tag:
name: Create tag from release PR
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'autorelease')
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v5
release:
uses: DragonAddons/wow-workflows/.github/workflows/release.yml@main
with:
fetch-depth: 0

- name: Extract version and create tag
id: tag
shell: bash
run: |
TITLE="${{ github.event.pull_request.title }}"
TAG=$(echo "$TITLE" | grep -oP '\d+\.\d+\.\d+')
if [ -z "$TAG" ]; then
echo "::error::Could not extract version from PR title: $TITLE"
exit 1
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"

changelog:
name: Generate changelog
needs: [create-tag]
if: >-
always() &&
github.event_name != 'pull_request' &&
(startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.vars.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Resolve tag
id: vars
shell: bash
run: |
TAG=""
if [ -n "${{ needs.create-tag.outputs.tag }}" ]; then
TAG="${{ needs.create-tag.outputs.tag }}"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag_name }}"
else
TAG="${{ github.ref_name }}"
fi
if [ -z "$TAG" ]; then
echo "::error::No tag could be resolved"
exit 1
fi
echo "tag=$TAG" >> "$GITHUB_OUTPUT"

- name: Generate changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --verbose
env:
OUTPUT: CHANGELOG.md
GITHUB_REPO: ${{ github.repository }}

- name: Commit changelog to default branch
shell: bash
run: |
BRANCH="${{ github.event.repository.default_branch }}"
git switch "$BRANCH"
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add CHANGELOG.md
if git diff --cached --quiet; then
exit 0
fi
git commit -m "Update changelog"
git push origin "HEAD:$BRANCH"

package:
name: Package
needs: [create-tag, changelog]
if: >-
always() && (
needs.create-tag.result == 'success' ||
startsWith(github.ref, 'refs/tags/') ||
github.event_name == 'workflow_dispatch'
)
runs-on: ubuntu-latest
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Resolve tag
id: resolve
shell: bash
run: |
TAG=""
if [ -n "${{ needs.create-tag.outputs.tag }}" ]; then
TAG="${{ needs.create-tag.outputs.tag }}"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag_name }}"
else
TAG="${{ github.ref_name }}"
fi
if [ -z "$TAG" ]; then
echo "::error::No tag could be resolved"
exit 1
fi
echo "TAG_NAME=$TAG" >> "$GITHUB_ENV"

- name: Checkout tag
uses: actions/checkout@v5
with:
ref: refs/tags/${{ env.TAG_NAME }}
fetch-depth: 0

- name: Package and upload
uses: BigWigsMods/packager@v2
env:
GITHUB_REF: refs/tags/${{ env.TAG_NAME }}
tag_name: ${{ inputs.tag_name || github.ref_name }}
secrets: inherit
17 changes: 3 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Packager files
.env
.release/

# Editor files
*.swp
*.swo
*~
.vscode/
.idea/

# OS files
.DS_Store
Thumbs.db

# Env files
.env
# Windows
nul
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.1.2"
}
Loading