Skip to content

Commit 553dc79

Browse files
committed
ci: Add main.yml to facilitate draft releases
1 parent 011277b commit 553dc79

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
2+
# - Remove Old Draft Releases
3+
# - Create New Draft Release
4+
# The workflow is triggered on push to the main branch
5+
#
6+
# GitHub Actions reference: https://help.github.com/en/actions
7+
#
8+
on:
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-latest
16+
steps:
17+
# Check out current repository
18+
- name: Fetch Sources
19+
uses: actions/checkout@v3
20+
21+
# Set up Java environment for the next steps
22+
- name: Setup Java
23+
uses: actions/setup-java@v3
24+
with:
25+
distribution: zulu
26+
java-version: 17
27+
28+
# Remove old release drafts by using the curl request for the available releases with a draft flag
29+
- name: Remove Old Release Drafts
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
gh api repos/{owner}/{repo}/releases \
34+
--jq '.[] | select(.draft == true) | .id' \
35+
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
36+
37+
# Create a new release draft which is not publicly visible and requires manual acceptance
38+
- name: Create Release Draft
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: |
42+
gh release create v${{ needs.build.outputs.version }} \
43+
--draft \
44+
--title "v${{ needs.build.outputs.version }}" \

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Collection of UI components and utilities for Jetpack Compose
66
- [x] Convention Plugins
77
- [ ] Sonarqube
88
- [x] CI/CD and PR validation, Spotless, Detekt, tests
9-
- [ ] Release management, Maven Publish, Changelog, Tags & Releases
9+
- [ ] Release management,
10+
- [x] Maven Publish
11+
- [ ] Changelog
12+
- [ ] Tags & Releases
1013
- [x] Documentation setup
1114

0 commit comments

Comments
 (0)