Skip to content
This repository was archived by the owner on Nov 29, 2025. It is now read-only.

Commit 664a2a3

Browse files
committed
Automate actions.
1 parent 6af2d83 commit 664a2a3

File tree

3 files changed

+119
-0
lines changed

3 files changed

+119
-0
lines changed

.github/RELEASE_HEAD.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**There may be a SMP's bug on installation. See wiki.
2+
REQUIRES SMP 1.6.1 (mod version attached has some improvements by [marc23](https://hydrogenaud.io/index.php/topic,116669.msg1026243.html#msg1026243))**
3+
4+
See full [changelog here](https://github.com/regorxxx/ListenBrainz-SMP/blob/main/CHANGELOG.md).

.github/workflows/clean.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Clean workflow runs (automatic)
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
# Run daily, at 00:00
7+
8+
jobs:
9+
delete:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
actions: write
13+
steps:
14+
- name: Delete workflow runs
15+
uses: Mattraks/delete-workflow-runs@v2
16+
with:
17+
token: ${{ github.token }}
18+
repository: ${{ github.repository }}
19+
retain_days: 0
20+
keep_minimum_runs: 1

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Create release + SMP + package
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Release tag: (X.X.X)'
8+
required: true
9+
type: string
10+
title:
11+
description: 'Release title:'
12+
required: false
13+
type: string
14+
15+
jobs:
16+
# Create new release + Tag
17+
release:
18+
name: 'Create release'
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v4.1.1
23+
- name: Bump version and push tag
24+
uses: mathieudutour/github-tag-action@v6.1
25+
with:
26+
github_token: ${{ secrets.GITHUB_TOKEN }}
27+
custom_tag: ${{ inputs.tag }}
28+
tag_prefix: 'v'
29+
- name: 'Create readme header'
30+
shell: bash
31+
working-directory: '.'
32+
run: |
33+
cp .github/RELEASE_HEAD.md RELEASE_HEAD.md
34+
- name: 'Create release notes'
35+
uses: CSchoel/release-notes-from-changelog@v1.3.0
36+
with:
37+
version: ${{ inputs.tag }}
38+
- name: 'Create Release using GitHub CLI'
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: >
42+
gh release create
43+
--verify-tag
44+
--latest
45+
-F RELEASE.md
46+
-t 'v${{ inputs.tag }} - ${{ inputs.title }}'
47+
'v${{ inputs.tag }}'
48+
# Attach assets
49+
mod:
50+
needs: release
51+
name: 'Attach SMP mod'
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: 'Get binaries'
56+
run: |
57+
curl -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
58+
-H 'Accept: application/vnd.github.v4.raw' \
59+
-O \
60+
-L https://api.github.com/repos/regorxxx/foobar2000-assets/contents/Spider%20Monkey%20Panel/foo_spider_monkey_panel-v1.6.1-mod.fb2k-component
61+
- uses: AButler/upload-release-assets@v3.0
62+
with:
63+
files: 'foo_spider_monkey_panel-v1.6.1-mod.fb2k-component'
64+
repo-token: ${{ secrets.GITHUB_TOKEN }}
65+
release-tag: 'v${{ inputs.tag }}'
66+
# Build and attach package
67+
package:
68+
needs: release
69+
name: 'Attach Package'
70+
runs-on: windows-latest
71+
72+
steps:
73+
- uses: thaitype/actions-switch-case@v1
74+
id: switch-case
75+
with:
76+
default: '0'
77+
conditionals-with-values: |
78+
${{ 'World-Map-SMP' == github.event.repository.name }} => '1'
79+
${{ 'Playlist-Manager-SMP' == github.event.repository.name }} => '2'
80+
${{ 'Not-a-Waveform-Seekbar-SMP' == github.event.repository.name }} => '3'
81+
${{ 'Timeline-SMP' == github.event.repository.name }} => '4'
82+
- uses: actions/checkout@v4.1.1
83+
if: ${{ steps.switch-case.outputs.match != '0' }}
84+
- name: 'Create package'
85+
if: ${{ steps.switch-case.outputs.match != '0'}}
86+
run: ./_createPackage.bat ${{ steps.switch-case.outputs.match }}
87+
- uses: AButler/upload-release-assets@v3.0
88+
if: ${{ steps.switch-case.outputs.match != '0' }}
89+
with:
90+
files: 'packages/*.zip'
91+
repo-token: ${{ secrets.GITHUB_TOKEN }}
92+
release-tag: 'v${{ inputs.tag }}'
93+
- name: 'No package associated to repository'
94+
if: ${{ steps.switch-case.outputs.match == '0' }}
95+
run: echo 'No package associated'

0 commit comments

Comments
 (0)