-
Notifications
You must be signed in to change notification settings - Fork 3
executable file
·48 lines (41 loc) · 1.54 KB
/
build-prod-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
on:
push:
branches:
- main
env:
DIST_DIR: ${{ github.workspace }}/build/dist
name: Build production release
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Check-out source code
uses: actions/checkout@v2
- name: Generate and process release PR
id: release_please
uses: GoogleCloudPlatform/release-please-action@v2
with:
release-type: simple
package-name: ${{ github.event.repository.name }}
- name: Define production release info
if: steps.release_please.outputs.release_created
run: |
tag=${{steps.release_please.outputs.tag_name}}
version=${{steps.release_please.outputs.version}}
major=${{steps.release_please.outputs.major}}
minor=${{steps.release_please.outputs.minor}}
patch=${{steps.release_please.outputs.patch}}
echo DO_RELEASE=true >> $GITHUB_ENV
echo RELEASE_TAG=${tag} >> $GITHUB_ENV
echo RELEASE_VERSION=${version} >> $GITHUB_ENV
- name: Build production release
if: env.DO_RELEASE
run: ./gradlew dist distThirdParty -Pversion=${{env.RELEASE_VERSION}}
- name: Upload assets to release
if: env.DO_RELEASE
run: |
tag=${{ steps.release_please.outputs.tag_name }}
files=$(find "${{ env.DIST_DIR }}" -type f -printf "%p ")
gh release upload "${tag}" $files --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}