-
Notifications
You must be signed in to change notification settings - Fork 39
98 lines (91 loc) · 3.16 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
persist-credentials: false
- name: Setup Java 11 and Apache Maven
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Configure GIT
run: |
git config --global user.name "Gluon Bot"
git config --global user.email "[email protected]"
- name: Publish to Maven Central
id: deploy
run: |
mvn deploy -DskipTests=true -B -U -Prelease
echo ::set-output name=exit_code::$?
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
commit-development-version:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
persist-credentials: false
- name: Commit next development version
run: |
TAG=${GITHUB_REF/refs\/tags\//}
SUBSTRATE_VERSION=$(mvn help:evaluate -Dexpression=substrate.version -q -DforceStdout)
NEW_SUBSTRATE_VERSION=${SUBSTRATE_VERSION%.*}.$((${SUBSTRATE_VERSION##*.} + 1))
NEW_PROJECT_VERSION=${TAG%.*}.$((${TAG##*.} + 1))
echo "Update project version to next snapshot version"
mvn versions:set -DnewVersion=$NEW_PROJECT_VERSION-SNAPSHOT -DgenerateBackupPoms=false
echo "Update Substrate to next snapshot version"
mvn versions:set-property -Dproperty=substrate.version -DnewVersion=$NEW_SUBSTRATE_VERSION-SNAPSHOT -DgenerateBackupPoms=false
git commit pom.xml -m "Prepare development of $NEW_PROJECT_VERSION"
git push https://gluon-bot:[email protected]/$GITHUB_REPOSITORY HEAD:master
shell: bash
env:
PAT: ${{ secrets.PAT }}
release-notes:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
update-repositories:
runs-on: ubuntu-latest
needs: [ release ]
steps:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install xmlstarlet
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
persist-credentials: false
- name: Update projects
if: steps.deploy.outputs.exit_code == 0
run: |
export TAG=${GITHUB_REF/refs\/tags\//}
bash $GITHUB_WORKSPACE/.github/scripts/release.sh
shell: bash
env:
GITHUB_PASSWORD: ${{ secrets.PAT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}