Skip to content

Commit 941ab89

Browse files
authored
Merge pull request #5 from Corneloues/copilot/update-github-actions-workflows
Add pre-release support to GitHub Actions workflows
2 parents 465bc78 + 0cca692 commit 941ab89

File tree

3 files changed

+141
-31
lines changed

3 files changed

+141
-31
lines changed

.github/workflows/build-mmip.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- 'v*.*.*' # Stable version tags
9+
- 'v*.*.*-*' # Pre-release tags (beta, alpha, rc)
710
workflow_dispatch:
811

912
permissions:
@@ -78,17 +81,21 @@ jobs:
7881
Write-Host "✅ Created MMIP: build/Soundchaser-TagTools.mmip"
7982
shell: pwsh
8083

81-
# 7. Commit and push to repo
82-
- name: Commit and push build artifacts
83-
run: |
84-
git config user.name "github-actions[bot]"
85-
git config user.email "github-actions[bot]@users.noreply.github.com"
86-
git add -f build/Soundchaser-TagTools.zip build/Soundchaser-TagTools.mmip
87-
git add src/info.json
88-
git diff --quiet && git diff --staged --quiet || (git commit -m "Update build artifacts [skip ci]" && git push)
89-
shell: pwsh
84+
# 7. Create GitHub Release (only for version tags)
85+
- name: Create GitHub Release
86+
if: startsWith(github.ref, 'refs/tags/v')
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
files: |
90+
build/Soundchaser-TagTools.mmip
91+
build/Soundchaser-TagTools.zip
92+
generate_release_notes: true
93+
draft: false
94+
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9097

91-
# 8. Upload as artifacts (optional backup)
98+
# 8. Upload as artifacts (for non-tagged builds)
9299
- name: Upload MMIP artifact as ZIP
93100
uses: actions/upload-artifact@v4
94101
with:

.github/workflows/bump-version.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ on:
1111
- patch
1212
- minor
1313
- major
14+
prerelease_type:
15+
description: 'Pre-release type (leave empty for stable)'
16+
required: false
17+
type: choice
18+
options:
19+
- ''
20+
- alpha
21+
- beta
22+
- rc
23+
prerelease_number:
24+
description: 'Pre-release number (e.g., 1 for beta.1)'
25+
required: false
26+
type: string
27+
default: '1'
1428

1529
permissions:
1630
contents: write
@@ -36,7 +50,11 @@ jobs:
3650
id: new_version
3751
run: |
3852
CURRENT="${{ steps.get_version.outputs.current }}"
39-
IFS='.' read -r -a parts <<< "$CURRENT"
53+
54+
# Strip any existing pre-release suffix (e.g., 1.0.0-beta.1 -> 1.0.0)
55+
BASE_VERSION="${CURRENT%%-*}"
56+
57+
IFS='.' read -r -a parts <<< "$BASE_VERSION"
4058
4159
# Validate version format
4260
if [ ${#parts[@]} -ne 3 ]; then
@@ -70,6 +88,12 @@ jobs:
7088
esac
7189
7290
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
91+
92+
# Add pre-release suffix if specified
93+
if [ -n "${{ inputs.prerelease_type }}" ]; then
94+
NEW_VERSION="$NEW_VERSION-${{ inputs.prerelease_type }}.${{ inputs.prerelease_number }}"
95+
fi
96+
7397
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
7498
echo "New version: $NEW_VERSION"
7599
@@ -98,5 +122,8 @@ jobs:
98122
echo "- **Previous version:** ${{ steps.get_version.outputs.current }}" >> $GITHUB_STEP_SUMMARY
99123
echo "- **New version:** ${{ steps.new_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
100124
echo "- **Bump type:** ${{ inputs.version_type }}" >> $GITHUB_STEP_SUMMARY
125+
if [ -n "${{ inputs.prerelease_type }}" ]; then
126+
echo "- **Pre-release:** ${{ inputs.prerelease_type }}.${{ inputs.prerelease_number }}" >> $GITHUB_STEP_SUMMARY
127+
fi
101128
echo "" >> $GITHUB_STEP_SUMMARY
102129
echo "A new release will be created automatically." >> $GITHUB_STEP_SUMMARY

CONTRIBUTING.md

Lines changed: 96 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,91 @@
11
# Contributing to Soundchaser-TagTools
22

3+
## Build and Release States
4+
5+
This project uses different workflows depending on your intent:
6+
7+
### 1. Development Builds (No Release)
8+
9+
**Use case:** Daily development, experiments, testing locally
10+
11+
**How:**
12+
- Just commit and push to `main`
13+
- No tag needed
14+
15+
**What happens:**
16+
- ✅ Workflow builds the `.mmip` file
17+
- ✅ Uploaded as a workflow artifact (available for 90 days)
18+
- ❌ No GitHub Release created
19+
- ❌ Users don't see it
20+
21+
**Download:** Go to Actions tab → Click workflow run → Download artifact
22+
23+
---
24+
25+
### 2. Pre-Release (Beta/Alpha Testing)
26+
27+
**Use case:** Share with testers before official release
28+
29+
**Version format:** `v1.0.0-beta.1`, `v1.0.0-alpha.1`, `v1.0.0-rc.1`
30+
31+
**How to create via GitHub Actions:**
32+
1. Go to **Actions****Bump Version**
33+
2. Click **Run workflow**
34+
3. Select version type (`patch`, `minor`, `major`)
35+
4. Select pre-release type (`alpha`, `beta`, or `rc`)
36+
5. Enter pre-release number (e.g., `1`)
37+
6. Click **Run workflow**
38+
39+
**What happens:**
40+
- ✅ Creates a GitHub Release
41+
- ⚠️ Marked as "Pre-release" (orange badge)
42+
- ❌ NOT marked as "Latest Release"
43+
- ✅ Can be downloaded from Releases page
44+
- ✅ Testers know it's not stable
45+
46+
---
47+
48+
### 3. Stable Release (Production)
49+
50+
**Use case:** Official, production-ready version for all users
51+
52+
**Version format:** `v1.0.0` (no suffix)
53+
54+
**How to create via GitHub Actions:**
55+
1. Go to **Actions****Bump Version**
56+
2. Click **Run workflow**
57+
3. Select version type (`patch`, `minor`, `major`)
58+
4. Leave pre-release type empty
59+
5. Click **Run workflow**
60+
61+
**What happens:**
62+
- ✅ Creates a GitHub Release
63+
- ✅ Marked as "Latest Release" (green badge)
64+
- ✅ Shown on repository homepage
65+
- ✅ Available at stable URL: `/releases/latest/download/...`
66+
67+
---
68+
69+
### Version Numbering
70+
71+
Follows [Semantic Versioning](https://semver.org/):
72+
73+
```
74+
MAJOR.MINOR.PATCH[-prerelease.number]
75+
│ │ │ │
76+
│ │ │ └─ Pre-release identifier (optional)
77+
│ │ └─────────── Bug fixes
78+
│ └────────────────── New features (backward compatible)
79+
└──────────────────────── Breaking changes
80+
```
81+
82+
**Examples:**
83+
- `1.0.0` - Stable release
84+
- `1.1.0-beta.1` - Beta pre-release
85+
- `1.1.0-beta.2` - Second beta
86+
- `1.1.0-rc.1` - Release candidate
87+
- `1.1.0` - Final stable after testing
88+
389
## Development Workflow
490

591
This repository contains a MediaMonkey 2024 AddOn that's distributed as an `.mmip` file via GitHub Releases.
@@ -23,9 +109,11 @@ git push origin main
23109

24110
### Creating a Release
25111

26-
When you're ready to publish a new stable version to users, you have two options:
112+
For information on creating releases, see the [Build and Release States](#build-and-release-states) section above.
27113

28-
#### Option A: Using GitHub Actions (Recommended)
114+
When you're ready to publish a new version to users:
115+
116+
#### Using GitHub Actions (Recommended)
29117

30118
1. Go to the **Actions** tab in GitHub
31119
2. Click on the **Bump Version** workflow
@@ -34,7 +122,8 @@ When you're ready to publish a new stable version to users, you have two options
34122
- **patch** (`1.0.0``1.0.1`): Bug fixes, small tweaks
35123
- **minor** (`1.0.0``1.1.0`): New features, new scripts
36124
- **major** (`1.0.0``2.0.0`): Breaking changes, major rewrites
37-
5. Click **Run workflow**
125+
5. (Optional) Select pre-release type for beta/alpha/rc releases
126+
6. Click **Run workflow**
38127

39128
**What happens automatically:**
40129
- Updates `version.txt` with the new version
@@ -43,15 +132,13 @@ When you're ready to publish a new stable version to users, you have two options
43132
- Triggers the build workflow
44133
- Creates a GitHub Release with the `.mmip` file
45134

46-
#### Option B: Using Local Scripts
135+
#### Using Local Scripts (Alternative)
47136

48137
If you prefer to work locally with PowerShell:
49138

50139
```powershell
51-
# 1. Bump the version
52-
./scripts/bump-patch.ps1 # For bug fixes
53-
./scripts/bump-minor.ps1 # For new features
54-
./scripts/bump-major.ps1 # For breaking changes
140+
# 1. Manually update version.txt (e.g., 1.1.0 or 1.1.0-beta.1)
141+
# Edit version.txt
55142
56143
# 2. Commit the version change
57144
git add version.txt
@@ -67,18 +154,7 @@ git push origin main --tags
67154
- A new GitHub Release is automatically created
68155
- Release notes are auto-generated from commits
69156
- The `.mmip` file is attached to the release
70-
71-
### Version Numbering (Semantic Versioning)
72-
73-
This project follows [Semantic Versioning](https://semver.org/):
74-
75-
```
76-
MAJOR.MINOR.PATCH
77-
│ │ │
78-
│ │ └─ Bug fixes, minor changes
79-
│ └─────── New features, new scripts (backward compatible)
80-
└───────────── Breaking changes, significant rewrites
81-
```
157+
- Pre-release status is detected from tag name (if it contains alpha/beta/rc)
82158

83159
### Download URLs
84160

0 commit comments

Comments
 (0)