forked from ChrisTitusTech/winutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ChrisTitusTech:main' into SoundSwitch
- Loading branch information
Showing
54 changed files
with
1,445 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
ignore: | ||
- dependency-name: "actions/stale" | ||
versions: '>= 9' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Close Discussion on PR Merge | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
closeDiscussion: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if PR was merged | ||
if: github.event.pull_request.merged == true | ||
run: echo "PR was merged" | ||
|
||
- name: Extract Discussion Number | ||
if: github.event.pull_request.merged == true | ||
id: extract-discussion | ||
run: | | ||
echo "discussion=$(echo '${{ github.event.pull_request.body }}' | grep -oP '(?<=Resolves #)\d+')" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Close the discussion | ||
if: github.event.pull_request.merged == true && steps.extract-discussion.outputs.discussion | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DISCUSSION_ID: ${{ steps.extract-discussion.outputs.discussion }} | ||
run: | | ||
curl -X PATCH -H "Authorization: token $GITHUB_TOKEN" \ | ||
-d '{"state": "closed"}' \ | ||
"https://api.github.com/repos/${{ github.repository }}/discussions/${DISCUSSION_ID}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Update update.mb on Release | ||
|
||
on: | ||
release: | ||
types: [published, prereleased] | ||
workflow_dispatch: # Add this line to enable manual triggering | ||
|
||
jobs: | ||
update-file: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get all releases and update update.mb file | ||
run: | | ||
# Fetch all releases including pre-releases using GitHub CLI | ||
gh release list --limit 5 > releases.txt | ||
# Extract numeric versions and create update.mb content | ||
echo "" > docs/update.mb | ||
while read -r line; do | ||
tag=$(echo "$line" | awk '{print $1}') | ||
name=$(echo "$line" | awk -F'\t' '{print $2}') | ||
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+') | ||
body=$(gh release view "$tag" --json body --jq .body) | ||
echo "## $version_numeric" >> docs/update.mb | ||
echo "Release name: $name" >> docs/update.mb | ||
echo "Release body: $body" >> docs/update.mb | ||
echo "" >> docs/update.mb | ||
done < releases.txt | ||
- name: Commit and Push Changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add docs/update.mb | ||
git commit -m "Update update.mb with all releases" | ||
git push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: GitHub Pages Deploy | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- uses: actions/cache@v4 | ||
with: | ||
key: ${{ github.ref }} | ||
path: .cache | ||
- run: pip install mkdocs-material | ||
- run: pip install pillow cairosvg | ||
- run: mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Close issue on /close | ||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
jobs: | ||
closeIssueOnClose: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: none | ||
contents: read | ||
|
||
steps: | ||
- name: Check for /close comment | ||
id: check_comment | ||
run: | | ||
if [[ "${{ contains(github.event.comment.body, '/close') }}" == "true" ]]; then | ||
echo "comment=true" >> $GITHUB_ENV | ||
else | ||
echo "comment=false" >> $GITHUB_ENV | ||
fi | ||
- name: Check if the user is allowed | ||
id: check_user | ||
if: env.comment == 'true' | ||
run: | | ||
ALLOWED_USERS=("ChrisTitusTech" "og-mrk" "Marterich" "MyDrift-user" "Real-MullaC") | ||
if [[ " ${ALLOWED_USERS[@]} " =~ " ${{ github.event.comment.user.login }} " ]]; then | ||
echo "user=true" >> $GITHUB_ENV | ||
else | ||
echo "user=false" >> $GITHUB_ENV | ||
fi | ||
- name: Close issue if conditions are met | ||
if: env.comment == 'true' && env.user == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ISSUE_NUMBER: ${{ github.event.issue.number }} | ||
run: | | ||
echo Closing the issue... | ||
gh issue close $ISSUE_NUMBER --repo ${{ github.repository }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,52 @@ | ||
name: Pre-Release WinUtil | ||
|
||
permissions: | ||
contents: write | ||
actions: read | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Compile"] #Ensure Compile winget.ps1 is done | ||
workflows: ["Compile"] | ||
types: | ||
- completed | ||
workflow_dispatch: # Manual trigger added | ||
|
||
jobs: | ||
build-runspace: | ||
runs-on: windows-latest | ||
outputs: | ||
version: ${{ steps.extract_version.outputs.version }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Extract Version from winutil.ps1 | ||
id: extract_version | ||
run: | | ||
$version = '' | ||
Get-Content ./winutil.ps1 -TotalCount 30 | ForEach-Object { | ||
if ($_ -match 'Version\s*:\s*(\d{2}\.\d{2}\.\d{2})') { | ||
$version = "pre"+$matches[1] | ||
echo "version=$version" >> $GITHUB_ENV | ||
echo "::set-output name=version::$version" | ||
break | ||
} | ||
} | ||
if (-not $version) { | ||
Write-Error "Version not found in winutil.ps1" | ||
exit 1 | ||
$version = (Get-Date -Format "yy.MM.dd") | ||
echo "version=$version" >> $env:GITHUB_ENV | ||
shell: pwsh | ||
|
||
- name: Create Tag | ||
id: create_tag | ||
run: | | ||
$tagExists = git tag -l $env:VERSION | ||
if ($tagExists -eq "") { | ||
git tag $env:VERSION | ||
git push origin $env:VERSION | ||
} else { | ||
Write-Host "Tag $env:VERSION already exists, skipping tag creation" | ||
} | ||
shell: pwsh | ||
|
||
- name: Create and Upload Release | ||
id: create_release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
tag_name: ${{ steps.extract_version.outputs.version }} | ||
name: Pre-Release ${{ steps.extract_version.outputs.version }} | ||
tag_name: ${{ env.VERSION }} | ||
name: Pre-Release ${{ env.VERSION }} | ||
body: "" | ||
append_body: false | ||
files: ./winutil.ps1 | ||
prerelease: true | ||
generate_release_notes: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Generate Sponsors README | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 30 15 * * 0-6 | ||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate Sponsors 💖 | ||
uses: JamesIves/github-sponsors-readme-action@v1 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
file: 'README.md' | ||
|
||
- name: Deploy to GitHub Pages 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: main | ||
folder: '.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.