11name : Release-plz
22
33on :
4- workflow_dispatch : # Manual releases only
5- inputs :
6- release_type :
7- description : ' Type of release (patch, minor, auto) - NO MAJOR BUMPS'
8- required : false
9- default : ' auto'
10- type : choice
11- options :
12- - auto
13- - patch
14- - minor
15- dry_run :
16- description : ' Dry run (no actual release)'
17- required : false
18- default : false
19- type : boolean
4+ push :
5+ branches :
6+ - main
207
218jobs :
229 release-plz-release :
2310 name : Release-plz release
2411 runs-on : ubuntu-latest
25- if : ${{ github.repository_owner == 'syncable-dev' && github.event.inputs.dry_run != 'true' }}
26-
12+ if : ${{ github.repository_owner == 'syncable-dev' }}
2713 permissions :
2814 contents : write
2915 steps :
30- - name : Show manual release inputs
31- run : |
32- echo "🚀 Manual Release Configuration:"
33- echo "Release Type: ${{ github.event.inputs.release_type || 'auto' }}"
34- echo "Dry Run: ${{ github.event.inputs.dry_run || 'false' }}"
35- echo "⚠️ Version Constraint: Will stay in 0.x.x range (no 1.0.0 bumps)"
36-
3716 - name : Checkout repository
3817 uses : actions/checkout@v4
3918 with :
4019 fetch-depth : 0
4120 token : ${{ secrets.RELEASE_PLZ_TOKEN }}
4221 - name : Install Rust toolchain
4322 uses : dtolnay/rust-toolchain@stable
44- - name : Check current version and constraints
45- run : |
46- CURRENT_VERSION=$(grep '^version =' Cargo.toml | cut -d'"' -f2)
47- echo "📊 Current version: $CURRENT_VERSION"
48- echo "📋 Release type: ${{ github.event.inputs.release_type || 'auto' }}"
49- echo "🎯 Version constraint: Max 0.99.99 (stays in 0.x.x range)"
50- echo "✅ Safe from automatic 1.0.0 bumps"
5123 - name : Run release-plz
5224 uses : release-plz/action@v0.5
5325 with :
@@ -56,56 +28,17 @@ jobs:
5628 GITHUB_TOKEN : ${{ secrets.RELEASE_PLZ_TOKEN }}
5729 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
5830
59- release-plz-dry-run :
60- name : Release-plz dry run
61- runs-on : ubuntu-latest
62- if : ${{ github.repository_owner == 'syncable-dev' && github.event.inputs.dry_run == 'true' }}
63- permissions :
64- contents : read
65- steps :
66- - name : Show dry run information
67- run : |
68- echo "🧪 DRY RUN MODE - No actual release will be performed"
69- echo "Release Type: ${{ github.event.inputs.release_type || 'auto' }}"
70- echo "This would analyze the repository and show what changes would be released."
71-
72- - name : Checkout repository
73- uses : actions/checkout@v4
74- with :
75- fetch-depth : 0
76- token : ${{ secrets.RELEASE_PLZ_TOKEN }}
77- - name : Install Rust toolchain
78- uses : dtolnay/rust-toolchain@stable
79- - name : Analyze release changes (dry run)
80- run : |
81- CURRENT_VERSION=$(grep '^version =' Cargo.toml | cut -d'"' -f2)
82- echo "📊 Analyzing repository for potential release..."
83- echo "Current version: $CURRENT_VERSION"
84- echo "Release type: ${{ github.event.inputs.release_type || 'auto' }}"
85- echo "🎯 Version constraint: Max 0.99.99 (will NOT bump to 1.0.0)"
86- echo ""
87- echo "Recent commits:"
88- git log --oneline -10
89- echo ""
90- echo "✅ Dry run complete - no actual release performed"
91- echo "🛡️ Protected from major version bumps!"
92-
9331 release-plz-pr :
9432 name : Release-plz PR
9533 runs-on : ubuntu-latest
96- if : ${{ github.repository_owner == 'syncable-dev' && github.event.inputs.dry_run != 'true' }}
34+ if : ${{ github.repository_owner == 'syncable-dev' }}
9735 permissions :
9836 pull-requests : write
9937 contents : write
10038 concurrency :
10139 group : release-plz-${{ github.ref }}
10240 cancel-in-progress : false
10341 steps :
104- - name : Show manual release inputs
105- run : |
106- echo "📝 Creating Release PR with configuration:"
107- echo "Release Type: ${{ github.event.inputs.release_type || 'auto' }}"
108-
10942 - name : Checkout repository
11043 uses : actions/checkout@v4
11144 with :
11952 command : release-pr
12053 env :
12154 GITHUB_TOKEN : ${{ secrets.RELEASE_PLZ_TOKEN }}
122- CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
55+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
0 commit comments