|
11 | 11 | required: false |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - version: |
| 14 | + release: |
15 | 15 | runs-on: ubuntu-latest |
16 | 16 | steps: |
17 | 17 | - uses: actions/checkout@v3 |
18 | 18 | with: |
19 | 19 | fetch-depth: 0 |
20 | | - - uses: actions/setup-java@v3 |
21 | | - with: |
22 | | - java-version: 11 |
23 | | - distribution: temurin |
24 | | - cache: maven |
25 | 20 | - name: Set release version |
26 | | - id: version |
| 21 | + env: |
| 22 | + RELEASE_VERSION: ${{ inputs.version }} |
27 | 23 | run: | |
28 | | - RELEASE_VERSION=${{ github.event.inputs.version }} |
29 | | - NEXT_VERSION=${{ github.event.inputs.next }} |
30 | | - PLAIN_VERSION=`echo ${RELEASE_VERSION} | awk 'match($0, /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)/) { print substr($0, RSTART, RLENGTH); }'` |
31 | | - COMPUTED_NEXT_VERSION="${PLAIN_VERSION}-SNAPSHOT" |
32 | | - if [ -z $NEXT_VERSION ] |
33 | | - then |
34 | | - NEXT_VERSION=$COMPUTED_NEXT_VERSION |
35 | | - fi |
36 | 24 | mvn -B versions:set versions:commit -DnewVersion=$RELEASE_VERSION |
37 | 25 | git config --global user.email "project.openubl.preview.bot@gmail.com" |
38 | 26 | git config --global user.name "Project-Openubl Bot" |
39 | 27 | git commit --allow-empty -a -m "🏁 Releasing version $RELEASE_VERSION" |
40 | 28 | git push origin HEAD:master |
41 | | - git rev-parse HEAD > HEAD |
42 | | - echo $RELEASE_VERSION > RELEASE_VERSION |
43 | | - echo $PLAIN_VERSION > PLAIN_VERSION |
44 | | - echo $NEXT_VERSION > NEXT_VERSION |
45 | | - - name: Upload version files |
46 | | - uses: actions/upload-artifact@v3 |
47 | | - with: |
48 | | - name: artifacts |
49 | | - path: | |
50 | | - HEAD |
51 | | - *_VERSION |
52 | | -
|
53 | | - release: |
54 | | - needs: [ version ] |
55 | | - runs-on: ubuntu-latest |
56 | | - steps: |
57 | | - - uses: actions/download-artifact@v3 |
58 | | - with: |
59 | | - name: artifacts |
60 | | - path: artifacts |
61 | | - - name: Read HEAD ref |
62 | | - id: head |
63 | | - uses: juliangruber/read-file-action@v1 |
64 | | - with: |
65 | | - path: artifacts/HEAD |
66 | | - - name: Read versions |
67 | | - id: version |
68 | | - run: | |
69 | | - RELEASE_VERSION=`cat artifacts/RELEASE_VERSION` |
70 | | - PLAIN_VERSION=`cat artifacts/PLAIN_VERSION` |
71 | | - NEXT_VERSION=`cat artifacts/NEXT_VERSION` |
72 | | - echo "RELEASE_VERSION = $RELEASE_VERSION" |
73 | | - echo "PLAIN_VERSION = $PLAIN_VERSION" |
74 | | - echo "NEXT_VERSION = $NEXT_VERSION" |
75 | | - echo "::set-output name=RELEASE_VERSION::$RELEASE_VERSION" |
76 | | - echo "::set-output name=PLAIN_VERSION::$PLAIN_VERSION" |
77 | | - echo "::set-output name=NEXT_VERSION::$NEXT_VERSION" |
78 | | - - uses: actions/checkout@v3 |
79 | | - with: |
80 | | - ref: ${{ steps.head.outputs.content }} |
81 | | - fetch-depth: 0 |
82 | 29 |
|
83 | 30 | # OSSRH |
84 | 31 | - uses: actions/setup-java@v3 |
85 | 32 | with: |
86 | 33 | distribution: "temurin" |
87 | 34 | java-version: 11 |
88 | | - cache: maven |
89 | 35 | server-id: ossrh |
90 | 36 | server-username: MAVEN_USERNAME |
91 | 37 | server-password: MAVEN_PASSWORD |
|
103 | 49 | with: |
104 | 50 | distribution: "temurin" |
105 | 51 | java-version: 11 |
106 | | - cache: maven |
107 | 52 | gpg-private-key: ${{ secrets.gpg_private_key }} |
108 | 53 | gpg-passphrase: MAVEN_GPG_PASSPHRASE |
109 | 54 | - name: GitHub Release |
|
116 | 61 | uses: jreleaser/release-action@v2 |
117 | 62 | env: |
118 | 63 | JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
119 | | - JRELEASER_PROJECT_VERSION: ${{ steps.version.outputs.RELEASE_VERSION }} |
| 64 | + JRELEASER_PROJECT_VERSION: ${{ inputs.version }} |
120 | 65 | JRELEASER_ZULIP_API_KEY: ${{ secrets.JRELEASER_ZULIP_API_KEY }} |
121 | 66 | JRELEASER_TWITTER_CONSUMER_KEY: ${{ secrets.JRELEASER_TWITTER_CONSUMER_KEY }} |
122 | 67 | JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.JRELEASER_TWITTER_CONSUMER_SECRET }} |
|
127 | 72 |
|
128 | 73 | - name: Set next version |
129 | 74 | env: |
130 | | - NEXT_VERSION: ${{ steps.version.outputs.NEXT_VERSION }} |
| 75 | + NEXT_VERSION: ${{ inputs.next }} |
131 | 76 | run: | |
132 | 77 | mvn -B versions:set versions:commit -DnewVersion=$NEXT_VERSION |
133 | 78 | git config --global user.email "project.openubl.preview.bot@gmail.com" |
|
0 commit comments