Skip to content

Commit 7d245cc

Browse files
authored
Merge branch 'ChrisTitusTech:main' into SoundSwitch
2 parents 8c51d66 + 508f909 commit 7d245cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1445
-446
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@ about: Create a report to help us improve
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

10-
**Describe the bug**
9+
## Describe the bug
1110
A clear and concise description of what the bug is.
1211

13-
**To Reproduce**
12+
## To Reproduce
1413
Steps to reproduce the behavior:
1514
1. Go to '...'
1615
2. Click on '....'
1716
3. Scroll down to '....'
1817
4. See error
1918

20-
**Expected behavior**
19+
## Expected behavior
2120
A clear and concise description of what you expected to happen.
2221

23-
**Screenshots**
22+
## Screenshots
2423
If applicable, add screenshots to help explain your problem.
2524

26-
**Additional context**
25+
## Additional context
2726
Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
[Discuss the impact of your changes on the project. This might include effects on performance, new dependencies, or changes in behaviour.]
2323

2424
## Issue related to PR
25-
[What issue is related to this PR (if any)]
25+
[What issue/discussion is related to this PR (if any)]
2626
- Resolves #
2727

2828
## Additional Information
@@ -33,4 +33,4 @@
3333
- [ ] I have performed a self-review of my own code.
3434
- [ ] I have commented my code, particularly in hard-to-understand areas.
3535
- [ ] I have made corresponding changes to the documentation.
36-
- [ ] My changes generate no errors/warnings/merge conflicts.
36+
- [ ] My changes generate no errors/warnings/merge conflicts.

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
ignore:
8+
- dependency-name: "actions/stale"
9+
versions: '>= 9'
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Close Discussion on PR Merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
closeDiscussion:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check if PR was merged
12+
if: github.event.pull_request.merged == true
13+
run: echo "PR was merged"
14+
15+
- name: Extract Discussion Number
16+
if: github.event.pull_request.merged == true
17+
id: extract-discussion
18+
run: |
19+
echo "discussion=$(echo '${{ github.event.pull_request.body }}' | grep -oP '(?<=Resolves #)\d+')" >> $GITHUB_OUTPUT
20+
shell: bash
21+
22+
- name: Close the discussion
23+
if: github.event.pull_request.merged == true && steps.extract-discussion.outputs.discussion
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
DISCUSSION_ID: ${{ steps.extract-discussion.outputs.discussion }}
27+
run: |
28+
curl -X PATCH -H "Authorization: token $GITHUB_TOKEN" \
29+
-d '{"state": "closed"}' \
30+
"https://api.github.com/repos/${{ github.repository }}/discussions/${DISCUSSION_ID}"

.github/workflows/createchangelog.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Update update.mb on Release
2+
3+
on:
4+
release:
5+
types: [published, prereleased]
6+
workflow_dispatch: # Add this line to enable manual triggering
7+
8+
jobs:
9+
update-file:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Get all releases and update update.mb file
17+
run: |
18+
# Fetch all releases including pre-releases using GitHub CLI
19+
gh release list --limit 5 > releases.txt
20+
21+
# Extract numeric versions and create update.mb content
22+
echo "" > docs/update.mb
23+
while read -r line; do
24+
tag=$(echo "$line" | awk '{print $1}')
25+
name=$(echo "$line" | awk -F'\t' '{print $2}')
26+
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+')
27+
body=$(gh release view "$tag" --json body --jq .body)
28+
echo "## $version_numeric" >> docs/update.mb
29+
echo "Release name: $name" >> docs/update.mb
30+
echo "Release body: $body" >> docs/update.mb
31+
echo "" >> docs/update.mb
32+
done < releases.txt
33+
34+
- name: Commit and Push Changes
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
git config --global user.name 'github-actions[bot]'
39+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
40+
git add docs/update.mb
41+
git commit -m "Update update.mb with all releases"
42+
git push

.github/workflows/github-pages.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: GitHub Pages Deploy
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
permissions:
8+
contents: write
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v4
15+
with:
16+
python-version: 3.x
17+
- uses: actions/cache@v4
18+
with:
19+
key: ${{ github.ref }}
20+
path: .cache
21+
- run: pip install mkdocs-material
22+
- run: pip install pillow cairosvg
23+
- run: mkdocs gh-deploy --force
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Close issue on /close
2+
3+
on:
4+
issue_comment:
5+
types: [created, edited]
6+
7+
jobs:
8+
closeIssueOnClose:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
pull-requests: none
13+
contents: read
14+
15+
steps:
16+
- name: Check for /close comment
17+
id: check_comment
18+
run: |
19+
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then
20+
echo "comment=true" >> $GITHUB_ENV
21+
else
22+
echo "comment=false" >> $GITHUB_ENV
23+
fi
24+
25+
- name: Check if the user is allowed
26+
id: check_user
27+
if: env.comment == 'true'
28+
run: |
29+
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC")
30+
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then
31+
echo "user=true" >> $GITHUB_ENV
32+
else
33+
echo "user=false" >> $GITHUB_ENV
34+
fi
35+
36+
- name: Close issue if conditions are met
37+
if: env.comment == 'true' && env.user == 'true'
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
ISSUE_NUMBER: ${{ github.event.issue.number }}
41+
run: |
42+
echo Closing the issue...
43+
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }}

.github/workflows/pre-release.yaml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
11
name: Pre-Release WinUtil
22

3+
permissions:
4+
contents: write
5+
actions: read
6+
37
on:
48
workflow_run:
5-
workflows: ["Compile"] #Ensure Compile winget.ps1 is done
9+
workflows: ["Compile"]
610
types:
711
- completed
812
workflow_dispatch: # Manual trigger added
913

1014
jobs:
1115
build-runspace:
1216
runs-on: windows-latest
13-
outputs:
14-
version: ${{ steps.extract_version.outputs.version }}
1517
steps:
1618
- name: Checkout Repository
1719
uses: actions/checkout@v4
1820

1921
- name: Extract Version from winutil.ps1
2022
id: extract_version
2123
run: |
22-
$version = ''
23-
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object {
24-
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') {
25-
$version = "pre"+$matches[1]
26-
echo "version=$version" >> $GITHUB_ENV
27-
echo "::set-output name=version::$version"
28-
break
29-
}
30-
}
31-
if (-not $version) {
32-
Write-Error "Version not found in winutil.ps1"
33-
exit 1
24+
$version = (Get-Date -Format "yy.MM.dd")
25+
echo "version=$version" >> $env:GITHUB_ENV
26+
shell: pwsh
27+
28+
- name: Create Tag
29+
id: create_tag
30+
run: |
31+
$tagExists = git tag -l $env:VERSION
32+
if ($tagExists -eq "") {
33+
git tag $env:VERSION
34+
git push origin $env:VERSION
35+
} else {
36+
Write-Host "Tag $env:VERSION already exists, skipping tag creation"
3437
}
3538
shell: pwsh
3639

3740
- name: Create and Upload Release
3841
id: create_release
3942
uses: softprops/action-gh-release@v2
4043
with:
41-
tag_name: ${{ steps.extract_version.outputs.version }}
42-
name: Pre-Release ${{ steps.extract_version.outputs.version }}
44+
tag_name: ${{ env.VERSION }}
45+
name: Pre-Release ${{ env.VERSION }}
46+
body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ env.VERSION }}/winutil.ps1)"
47+
append_body: false
4348
files: ./winutil.ps1
4449
prerelease: true
50+
generate_release_notes: true
4551
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ jobs:
1919
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object {
2020
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') {
2121
$version = $matches[1]
22-
echo "version=$version" >> $GITHUB_ENV
23-
echo "::set-output name=version::$version"
22+
echo "version=$version" >> $GITHUB_OUTPUT
2423
break
2524
}
2625
}
@@ -36,6 +35,8 @@ jobs:
3635
with:
3736
tag_name: ${{ steps.extract_version.outputs.version }}
3837
name: Release ${{ steps.extract_version.outputs.version }}
38+
body: "![GitHub Downloads (specific asset, specific tag)](https://img.shields.io/github/downloads/ChrisTitusTech/winutil/${{ steps.extract_version.outputs.version }}/winutil.ps1)"
39+
append_body: true
3940
files: ./winutil.ps1
4041
prerelease: false
4142
make_latest: "true"

.github/workflows/sponsors.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Generate Sponsors README
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: 30 15 * * 0-6
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout 🛎️
13+
uses: actions/checkout@v4
14+
15+
- name: Generate Sponsors 💖
16+
uses: JamesIves/github-sponsors-readme-action@v1
17+
with:
18+
token: ${{ secrets.PAT }}
19+
file: 'README.md'
20+
21+
- name: Deploy to GitHub Pages 🚀
22+
uses: JamesIves/github-pages-deploy-action@v4
23+
with:
24+
branch: main
25+
folder: '.'

0 commit comments

Comments
 (0)