-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (68 loc) · 2.58 KB
/
ci.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
name: ci
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- uses: actions/setup-python@v2
with:
python-version: 3.x
- shell: bash
run: mvn help:evaluate -Dexpression=major.minor.version -q -DforceStdout > version.log
- shell: bash
run: mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout > artifactid.log
- name: Set env version
run: echo "MM_VERSION=$(cat version.log)" >> $GITHUB_ENV
- name: Set env version
run: echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Set env name
run: echo "RELEASE_ARTIFACTID=$(cat artifactid.log)" >> $GITHUB_ENV
- name: test
run: echo ${{ env.RELEASE_VERSION }} ${{ env.RELEASE_ARTIFACTID }}
- run: pip install mkdocs-material
- run: pip install mkdocs-macros-plugin
- run: sed -i "s/\$VERSION/$(cat version.log)/g" mkdocs.yml
- run: sed -i "s/\$RELEASE_VERSION/${{ env.RELEASE_VERSION }}/g" mkdocs.yml
- run: mkdocs build -d site/$(cat version.log)
- run: mvn javadoc:javadoc
- run: sed -i "s/\$VERSION/$(cat version.log)/g" index.html
- run: cp index.html ./site
- name: Deploy Site
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site/${{ env.MM_VERSION }}
destination_dir: ./${{ env.MM_VERSION }}
- run: mvn package -Dmaven.test.skip=true
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.RELEASE_VERSION }}
release_name: version ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
body_path: CHANGELOG.md
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/${{ env.RELEASE_ARTIFACTID }}-${{ env.RELEASE_VERSION }}-shaded.jar
asset_name: lpbenchgen-${{ env.RELEASE_VERSION }}.jar
asset_content_type: application/zip
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}