@@ -2,7 +2,12 @@ name: Build
22
33on :
44 push :
5- branches : ["master"]
5+ branches :
6+ - " master"
7+ - " feat/**"
8+ - " fix/**"
9+ tags :
10+ - " v*.*.*" # Semantic version tags
611 pull_request :
712 branches : ["master"]
813
@@ -118,6 +123,14 @@ jobs:
118123 # Build guest programs in parallel using matrix
119124 build-guest :
120125 runs-on : ubuntu-latest
126+ # Run on main branches, release branches, or when explicitly requested
127+ if : |
128+ github.ref == 'refs/heads/master' ||
129+ github.ref == 'refs/heads/develop' ||
130+ startsWith(github.ref, 'refs/heads/release/') ||
131+ startsWith(github.ref, 'refs/heads/hotfix/') ||
132+ startsWith(github.ref, 'refs/tags/v') ||
133+ contains(github.event.pull_request.labels.*.name, 'full-build')
121134 strategy :
122135 matrix :
123136 guest : [
@@ -183,3 +196,33 @@ jobs:
183196 path : output/
184197 retention-days : 7
185198
199+ # Semantic release - automatically create releases based on conventional commits
200+ semantic-release :
201+ runs-on : ubuntu-latest
202+ # Only run on master branch pushes after all other jobs pass
203+ if : github.ref == 'refs/heads/master' && github.event_name == 'push'
204+ needs : [check-fmt, check-wasm, clippy-root, clippy-guests, test, build-guest]
205+ permissions :
206+ contents : write
207+ issues : write
208+ pull-requests : write
209+ steps :
210+ - uses : actions/checkout@v4
211+ with :
212+ fetch-depth : 0
213+ token : ${{ secrets.GITHUB_TOKEN }}
214+
215+ - name : Setup Node.js
216+ uses : actions/setup-node@v4
217+ with :
218+ node-version : ' 20'
219+
220+ - name : Install semantic-release
221+ run : |
222+ npm install -g semantic-release @semantic-release/changelog @semantic-release/git
223+
224+ - name : Semantic Release
225+ run : semantic-release
226+ env :
227+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
228+
0 commit comments