-
Notifications
You must be signed in to change notification settings - Fork 6
82 lines (72 loc) · 2.17 KB
/
release.yml
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release new version
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name to publish'
required: true
jobs:
bump-version:
runs-on: ubuntu-latest
env:
newVersion: ${{ github.event.inputs.tag_name }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ci-auto-version-bump
- name: Bump version
run: |
newVersion=$(echo $newVersion | sed 's/^v//')
sed -i.bak "s/^version=.*/version=$newVersion/" gradle.properties
rm gradle.properties.bak
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Commit version bump
run: |
git add gradle.properties
git commit -m "chore: Bump version to $newVersion"
- name: Tag version
run: |
git tag $newVersion
- name: Push changes
run: |
git push origin ci-auto-version-bump
# Push tag
git push origin $newVersion
build:
needs: bump-version
uses: ./.github/workflows/build.yml
publish:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag_name}}
- name: Download uber-jar
uses: actions/[email protected]
with:
name: ${{ needs.build.outputs.uber-jar }}
- name: Download sources-jar
uses: actions/[email protected]
with:
name: ${{ needs.build.outputs.sources-jar }}
- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ${{ needs.build.outputs.uber-jar }}
tags: true
draft: false
tag_name: ${{ github.event.inputs.tag_name }}
# - name: Deploy to Maven Central repository
# run: ./gradlew publish
# env:
# MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }}
# MAVEN_REPO_PASSWORD: ${{ secrets.MAVEN_REPO_PASSWORD }}
# GRADLE_SIGNING_KEY: ${{ secrets.GRADLE_SIGNING_KEY }}
# GRADLE_SIGNING_PASSWORD: ${{ secrets.GRADLE_SIGNING_PASSWORD }}