-
Notifications
You must be signed in to change notification settings - Fork 6
51 lines (43 loc) · 1.44 KB
/
release-dev.yml
File metadata and controls
51 lines (43 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Release Dev
on:
workflow_dispatch:
jobs:
release-dev:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: gradle
- name: Compute dev version
id: version
run: |
YEAR=$(date +'%y')
MONTH=$(date +'%m')
SHORT_COMMIT=$(git rev-parse --short HEAD)
# Count commits this month (YYYY-MM-01 to now)
MONTH_START="${YEAR}-${MONTH}-01"
N=$(git log --oneline --after="${MONTH_START}" | wc -l | tr -d ' ')
VERSION="dev-${YEAR}.${MONTH}.${N}-${SHORT_COMMIT}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "Dev version: ${VERSION}"
- name: Build
run: chmod +x gradlew && ./gradlew build -PoverrideVersion=${{ steps.version.outputs.version }}
- name: Create pre-release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.version }}
name: Dev Build ${{ steps.version.outputs.version }}
prerelease: true
files: build/libs/SimpPay-*.jar
body: |
Automated dev build from commit ${{ github.sha }}
> This is a pre-release build. Use at your own risk.