-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (68 loc) · 2.21 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
name: Publisher
"on":
- workflow_dispatch
jobs:
build:
environment: deployment
runs-on: ubuntu-latest
env:
RELEASER_CHANGER: gradle-properties
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: "${{ secrets.ACTIONS_PAT }}"
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '8'
- uses: anatawa12/something-releaser@v2
- run: set-git-user anatawa12-bot
- name: Update Version
id: up
run: |
# set current version
VERSION="$(get-version)"
if ! [[ "$VERSION" = *-SNAPSHOT ]]; then
echo 'VERSION IS NOT SNAPSHOT' >&2
exit 1
fi
VERSION="$(version-unsnapshot "$VERSION")"
set-version "$VERSION"
# create changelog
generate-changelog -v "$VERSION"
# create changelog for this release
RELEASE_NOTE="$(mktemp)"
echo "::set-output name=RELEASE_NOTE::$RELEASE_NOTE"
generate-changelog -v "$VERSION" --unreleased-only --stdout >> "$RELEASE_NOTE"
# update versions in readme and example
perl -pi \
-e 's/(?<=\Q("com.anatawa12.compile-time-constant") version \E)".*"/"'$VERSION'"/' \
README.md \
example/build.gradle.kts
# commit & tag
git add .
git commit -m "v$VERSION"
git tag "v$VERSION"
- run: |
./gradlew build
git push && git push --tags
- name: Create New Release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_NOTE: ${{ steps.up.outputs.RELEASE_NOTE }}
run: |
VERSION="$(get-version)"
gh release create "v$VERSION" \
--notes-file "$RELEASE_NOTE"
gh release upload "v$VERSION" \
"build/libs/plugin-permissions-for-ngt-$VERSION.jar"
- name: Update To Next Version
run: |
VERSION="$(get-version)"
VERSION="$(version-next "$VERSION")"
set-version "$(version-snapshot "$VERSION")"
git add .
git commit -m "prepare for next version: $VERSION"
git push