Skip to content

Commit 18ec179

Browse files
Publish and create release from github action (#16)
1 parent d8f6f78 commit 18ec179

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: Publish
22

33
on:
4-
release:
4+
# release:
55
# We'll run this workflow when a new GitHub release is created
6-
types: [released]
6+
# types: [released]
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version eg v1.0.0'
11+
required: true
12+
type: string
713

814
jobs:
915
publish:
@@ -34,8 +40,21 @@ jobs:
3440
./gradlew closeAndReleaseRepository
3541
echo "Released ✅"
3642
env:
37-
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.release.tag_name }}
43+
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.version }}
3844
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
3945
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
4046
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
4147
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
48+
49+
- name: Git push tag
50+
run: |
51+
git tag -a ${{ github.event.inputs.version }} -m "Release version ${{ github.event.inputs.version }}"
52+
git push origin ${{ github.event.inputs.version }}
53+
54+
- name: Create Release
55+
uses: ncipollo/[email protected]
56+
with:
57+
tag: "${{ github.event.inputs.version }}"
58+
generateReleaseNotes: true
59+
commit: "master"
60+
makeLatest: true

speld/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ android {
3737
compose true
3838
}
3939
namespace 'com.yogeshpaliyal.speld'
40+
publishing {
41+
singleVariant("release") {
42+
withSourcesJar()
43+
}
44+
}
4045
}
4146

4247
dependencies {

0 commit comments

Comments
 (0)