forked from eclipse-esmf/esmf-semantic-aspect-meta-model
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (71 loc) · 2.93 KB
/
release-artifact.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
name: Release Artifact
on:
workflow_dispatch:
inputs:
release_version:
description: 'Version number of the release'
required: true
jobs:
build-and-release:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
gpg-private-key: ${{ secrets.PGP_KEY }}
gpg-passphrase: PGP_KEY_PASSWORD
overwrite-settings: true
- name: Set release version in antora.yml
uses: mikefarah/yq@master
with:
cmd: yq eval -i '.version = "${{ github.event.inputs.release_version }}"' documentation/antora.yml
- name: Build SAMM artifact and release to OSSRH
run: |
set -x
rm -rf ~/.m2/repository/org/eclipse/esmf
./mvnw -B versions:set -DnewVersion=${{ github.event.inputs.release_version }}
./mvnw -B versions:commit
# Since the meta model project itself does not inherit from the parent, we must set its version separately
./mvnw -B versions:set -DnewVersion=${{ github.event.inputs.release_version }} -pl esmf-semantic-aspect-meta-model
./mvnw -B versions:commit -pl esmf-semantic-aspect-meta-model
./mvnw -B clean generate-resources -pl documentation -Pantora
./mvnw -B -U clean install -pl esmf-samm-build-plugin
./mvnw -B -U clean deploy -pl esmf-semantic-aspect-meta-model -Psign,release-build
cd build/
mv site SAMM-${{ github.event.inputs.release_version }}
zip -r ../SAMM-${{ github.event.inputs.release_version }}-specification.zip SAMM-${{ github.event.inputs.release_version }}
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
# If the deployment to OSSRH went through, the following steps will
# - Commit updated version to release branch
# - Create Github release
- name: Commit version changes and push to upstream repository
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ env.release_branch_name }}
commit_user_name: github-actions
commit_user_email: [email protected]
commit_author: Author <[email protected]>
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body: "Create Github release"
tag_name: v${{ github.event.inputs.release_version }}
target_commitish: ${{ env.release_branch_name }}
draft: false
prerelease: false
files: |
esmf-semantic-aspect-meta-model/target/*.jar
esmf-semantic-aspect-meta-model/target/*.asc
SAMM-*-specification.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}