-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (57 loc) · 1.89 KB
/
release.yml
File metadata and controls
59 lines (57 loc) · 1.89 KB
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
name: release
on:
push:
tags:
- 'v*'
env:
FILENAME: plugin-demo-java
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: '8.0.181'
java-package: jdk
architecture: x64
- name: Set up Maven
uses: stCarolas/setup-maven@v3
with:
maven-version: 3.6.1
- name: Change Maven Settings
uses: whelk-io/maven-settings-xml-action@v12
with:
servers: '[{ "id": "github", "username": "${{ secrets.PRIVATE_GITHUB_REPO_USER }}", "password":"${{ secrets.PRIVATE_GITHUB_REPO_PASSWORD }}"}]'
- name: Build
run: mvn clean package
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.FILENAME }}.zip
# A file, directory or wildcard pattern that describes what to upload
path: ./target/${{ env.FILENAME }}.zip
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: true
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/${{ env.FILENAME }}.zip
asset_name: ${{ env.FILENAME }}.zip
asset_content_type: application/zip