-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (64 loc) · 2.48 KB
/
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
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
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'The version of the release. Used as tag name.'
required: true
default: 'x.y.z'
dryRun:
description: 'Run a dry-run release'
type: boolean
required: false
default: false
jobs:
build:
name: Release pipeline
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
cache: 'maven'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Create json file
id: create-json
uses: jsdaniell/[email protected]
with:
name: "presales-gdrive-service.json"
json: ${{ secrets.GD_SERVICE_ACCOUNT }}
- name: Move files
run: |
mkdir -p $HOME/gdrive
cp presales-gdrive-service.json $HOME/gdrive
ls -ltr $HOME/gdrive
- name: Build and Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --batch-mode release:prepare release:perform -DreleaseVersion=${{ github.event.inputs.version }} -DdryRun=${{ github.event.inputs.dryRun }}
- uses: actions/create-release@latest
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: false
prerelease: false
- uses: actions/upload-release-asset@v1
id: upload-release-asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: target/connector-gdrive-${{ github.event.inputs.version }}.jar
asset_name: connector-gdrive-${{ github.event.inputs.version }}.jar
asset_content_type: application/zip