-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (120 loc) · 4.01 KB
/
release_girders.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Release Girders
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version'
required: true
type: string
developmentVersion:
description: 'Development version after release'
required: true
type: string
publishTo:
description: 'Publish to'
required: true
default: 'MavenCentral'
type: choice
options:
- 'MavenCentral'
- 'none (dry run)'
env:
RELEASE_VERSION: ${{ inputs.releaseVersion }}
DEVELOPMENT_VERSION: ${{ inputs.developmentVersion }}
PUBLISH_TO: ${{ inputs.publishTo }}
jobs:
log_inputs:
name: log the input params
runs-on: ubuntu-latest
steps:
- name: log the input params
run: |
echo "Release version: $RELEASE_VERSION"
echo "Development version: $DEVELOPMENT_VERSION"
echo "Publish to: $PUBLISH_TO"
build_release:
name: build girders release
runs-on: ubuntu-latest
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17.0.0'
distribution: 'zulu'
cache: 'maven'
server-id: 'ossrh' # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME # same name as above env variable
server-password: MAVEN_PASSWORD # same name as above env variable
gpg-private-key: ${{ secrets.PGP_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE # same name as above env variable
- name: Configure git user
run: |
git config user.email "[email protected]"
git config user.name "GithubActionsBot"
- name: Maven clean
run: mvn --batch-mode clean release:clean
shell: bash
- name: Maven release:prepare
run: mvn --batch-mode -DdryRun=${{ env.PUBLISH_TO == 'none (dry run)' }} -DdevelopmentVersion=$DEVELOPMENT_VERSION -DreleaseVersion=$RELEASE_VERSION release:prepare
shell: bash
- name: Maven release:perform
run: mvn --batch-mode -Prelease -DdryRun=${{ env.PUBLISH_TO == 'none (dry run)' }} org.apache.maven.plugins:maven-release-plugin:2.5.3:perform
shell: bash
deploy_github_page:
name: deploy github page
needs: build_release
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pages: write
steps:
- name: Checkout release version
uses: actions/checkout@v3
with:
ref: girders-${{ env.RELEASE_VERSION }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17.0.0'
distribution: 'zulu'
cache: 'maven'
- name: Build maven site
run: mvn site:site
shell: bash
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'target/site/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
create_github_release_notes:
name: create github release notes
needs: build_release
runs-on: ubuntu-latest
steps:
- name: Checkout release version
uses: actions/checkout@v3
with:
ref: girders-${{ env.RELEASE_VERSION }}
- name: Create release notes
uses: softprops/action-gh-release@v1
with:
tag_name: girders-${{ env.RELEASE_VERSION }}
prerelease: false
name: Girders ${{ env.RELEASE_VERSION }}
generate_release_notes: true
body_path: ${{ github.workspace }}/.github/release_notes_template.md