Skip to content

Commit 3e36150

Browse files
committed
chore: release
1 parent 80c7f26 commit 3e36150

8 files changed

Lines changed: 281 additions & 0 deletions

File tree

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch: # allow manual run
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
env:
15+
CONFIG_FILE_PATH: Repo/release-please-config.json
16+
MANIFEST_FILE_PATH: Repo/.release-please-manifest.json
17+
RELEASE_NOTES_PATH: Repo/release-notes.md
18+
19+
jobs:
20+
release-please:
21+
runs-on: ubuntu-latest
22+
23+
outputs:
24+
release--tag_name: ${{ steps.release.outputs.tag_name }}
25+
release--releases_created: ${{ steps.release.outputs.releases_created }}
26+
release--prs_createde: ${{ steps.release.outputs.prs_created }}
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v5
31+
32+
- name: Starting log
33+
run: |
34+
echo "🐧 This job is running on a ${{ runner.os }} server hosted by GitHub!"
35+
echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
36+
echo "📰 This job is triggered by this event: ${{ github.event_name }}"
37+
38+
- name: Check working directory
39+
run: |
40+
pwd
41+
if [ -d "Repo" ]; then
42+
echo "/Repo content:"
43+
ls -la Repo
44+
else
45+
echo "/Repo sub-dir doesn’t exist. Show root:"
46+
ls -la
47+
fi
48+
49+
- name: Check config file
50+
run: |
51+
cat $CONFIG_FILE_PATH || echo "'release-please-config.json' not found"
52+
cat $MANIFEST_FILE_PATH || echo "'.release-please-manifest.json' not found"
53+
54+
- name: Run Release Please
55+
id: release
56+
uses: googleapis/release-please-action@v4
57+
with:
58+
token: ${{ secrets.GITHUB_TOKEN }}
59+
config-file: ${{ env.CONFIG_FILE_PATH }}
60+
manifest-file: ${{ env.MANIFEST_FILE_PATH }}
61+
62+
- name: Print release outputs for debugging
63+
run: |
64+
echo "Release outputs:"
65+
echo "RELEASE CREATED: ${{ steps.release.outputs.releases_created }}" | tee -a $GITHUB_STEP_SUMMARY
66+
echo "PR CREATED/UPDATED: ${{ steps.release.outputs.prs_created }}" | tee -a $GITHUB_STEP_SUMMARY
67+
68+
- name: Status
69+
run: echo "🍏 This job's status is ${{ job.status }}."
70+
71+
release-zip:
72+
if: ${{ needs.release-please.outputs.release--releases_created == 'true' }}
73+
runs-on: ubuntu-latest
74+
needs: release-please
75+
76+
steps:
77+
- name: Checkout code
78+
uses: actions/checkout@v5
79+
80+
- name: Starting log
81+
run: |
82+
echo "🐧 This job is running on a ${{ runner.os }} server hosted by GitHub!"
83+
echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
84+
echo "📰 This job is triggered by this event: ${{ github.event_name }}"
85+
86+
- name: Print release outputs for debugging
87+
run: |
88+
echo "Release outputs:"
89+
echo "RELEASE CREATED: ${{ needs.release-please.outputs.release--releases_created }}" | tee -a $GITHUB_STEP_SUMMARY
90+
echo "PR CREATED/UPDATED: ${{ needs.release-please.outputs.release--prs_createde }}" | tee -a $GITHUB_STEP_SUMMARY
91+
92+
- name: Create ZIP archive
93+
run: |
94+
zip -r yt-download-${{ needs.release-please.outputs.release--tag_name }}.zip powershell/*.ps1 2>/dev/null || true
95+
96+
- name: Upload ZIP to Release
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
run: |
100+
gh release upload ${{ needs.release-please.outputs.release--tag_name }} ./yt-download-${{ needs.release-please.outputs.release--tag_name }}.zip --clobber
101+
102+
# - name: Get release-notes
103+
# id: get-notes
104+
# run: |
105+
# echo "RELEASE_NOTES<<EOF" >> $GITHUB_OUTPUT
106+
# cat ${{ env.RELEASE_NOTES_PATH }} >> $GITHUB_OUTPUT
107+
# echo "EOF" >> $GITHUB_OUTPUT
108+
109+
- name: Concatenate release-notes
110+
id: edit-notes
111+
env:
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113+
run: |
114+
gh release edit ${{ needs.release-please.outputs.release--tag_name }} --notes "$(gh release view ${{ needs.release-please.outputs.release--tag_name }} --json body --jq '.body') $(cat ${{ env.RELEASE_NOTES_PATH }})"
115+
116+
- name: Status
117+
run: echo "🍏 This job's status is ${{ job.status }}."
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# https://github.com/Nats-ji/delete-old-releases
2+
name: Delete old releases
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
count:
8+
description: "Keep latest X releases"
9+
required: true
10+
type: number
11+
default: 1
12+
keepMinor:
13+
description: "Keep the latest release of each older minor versions."
14+
required: true
15+
type: boolean
16+
default: false
17+
minorCount:
18+
description: "Number of old releases in each minor version to keep."
19+
required: true
20+
type: number
21+
default: 1
22+
minorType:
23+
description: "Which semver level should we use to keep old release"
24+
required: true
25+
type: choice
26+
default: "major"
27+
options:
28+
- major
29+
- minor
30+
- patch
31+
32+
jobs:
33+
delete:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Starting log
37+
run: |
38+
echo "🐧 This job is running on a ${{ runner.os }} server hosted by GitHub!"
39+
echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
40+
echo "📰 This job is triggered by this event: ${{ github.event_name }}"
41+
- uses: actions/checkout@v3
42+
- uses: Nats-ji/delete-old-releases@v1
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
keep-count: ${{ inputs.count }}
46+
keep-old-minor-releases: ${{ inputs.keepMinor }}
47+
keep-old-minor-releases-count: ${{ inputs.minorCount }}
48+
keep-old-minor-releases-by: ${{ inputs.minorType }}
49+
- run: echo "🍏 This job's status is ${{ job.status }}."

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99
"darwin-arm64": "./user script/node_modules/@biomejs/biome/bin/biome",
1010

1111
"win32-x64": "./user script/node_modules/@biomejs/cli-win32-x64/biome.exe"
12+
},
13+
"powershell.debugging.createTemporaryIntegratedConsole": true,
14+
"powershell.debugging.executeMode": "Call",
15+
"[markdown]": {
16+
"editor.formatOnSave": false
1217
}
1318
}

Repo/.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.0"
3+
}

Repo/CHANGELOG.md

Whitespace-only changes.

Repo/release-notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
3+
# How to Install
4+
5+
Download `yt-download.zip` and read the [wiki](https://github.com/Fred-Vatin/run-yt-dlp-from-browser/wiki).

Repo/release-please-config.json

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"include-component-in-tag": false,
4+
"include-v-in-tag": true,
5+
"pull-request-header": "🤖 release please",
6+
"pull-request-footer": " ",
7+
"packages": {
8+
".": {
9+
"package-name": "yt-download",
10+
"changelog-path": "Repo/CHANGELOG.md",
11+
"changelog-sections": [
12+
{
13+
"type": "build",
14+
"hidden": false,
15+
"section": "🧰 Other"
16+
},
17+
{
18+
"type": "change",
19+
"hidden": false,
20+
"section": "🚀 Features"
21+
},
22+
{
23+
"type": "chore",
24+
"hidden": true,
25+
"section": "🧰 Other"
26+
},
27+
{
28+
"type": "ci",
29+
"hidden": true,
30+
"section": "🧰 Other"
31+
},
32+
{
33+
"type": "deprecate",
34+
"hidden": false,
35+
"section": "⚠️ Changes"
36+
},
37+
{
38+
"type": "deps",
39+
"hidden": true,
40+
"section": "🧰 Other"
41+
},
42+
{
43+
"type": "docs",
44+
"hidden": false,
45+
"section": "📚 Documentation"
46+
},
47+
{
48+
"type": "feat",
49+
"hidden": false,
50+
"section": "🚀 Features"
51+
},
52+
{
53+
"type": "fix",
54+
"hidden": false,
55+
"section": "🐞 Bug Fixes"
56+
},
57+
{
58+
"type": "perf",
59+
"hidden": false,
60+
"section": "✨ Polish"
61+
},
62+
{
63+
"type": "refactor",
64+
"hidden": false,
65+
"section": "✨ Polish"
66+
},
67+
{
68+
"type": "remove",
69+
"hidden": false,
70+
"section": "⚠️ Changes"
71+
},
72+
{
73+
"type": "revert",
74+
"hidden": false,
75+
"section": "🐞 Bug Fixes"
76+
},
77+
{
78+
"type": "security",
79+
"hidden": false,
80+
"section": "🐞 Bug Fixes"
81+
},
82+
{
83+
"type": "style",
84+
"hidden": false,
85+
"section": "✨ Polish"
86+
},
87+
{
88+
"type": "test",
89+
"hidden": false,
90+
"section": "🧪 Tests"
91+
}
92+
]
93+
}
94+
},
95+
"release-type": "simple",
96+
"separate-pull-requests": true,
97+
"always-update": true,
98+
"tag-separator": "@"
99+
}

user script/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
3232

3333
# Finder (MacOS) folder config
3434
.DS_Store
35+
36+
# vscode
37+
.vscode/bookmarks.json

0 commit comments

Comments
 (0)