-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (74 loc) · 3.02 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:
push:
tags:
- 'v*'
# workflow_dispatch:
# inputs:
# trigger:
# description: Type m to triggre manual jobs
# required: false
# default: ''
env:
JAVA_VERSION: '17'
jobs:
release:
# if: startsWith(github.event.inputs.trigger, 'm')
# || startsWith(github.event.inputs.trigger, 'M')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ env.JAVA_VERSION }}
- uses: actions/cache@v3
with:
path: |
~/.m2
~/.npm
~/.docker
~/.gradle
key: ${{ runner.os }}-build-${{ hashFiles('**/*gradle*', '**/pom.xml') }}
- run: cd $GITHUB_WORKSPACE ; ./gradlew --no-daemon --stop
- run: cd $GITHUB_WORKSPACE ; ./gradlew --no-daemon --console=plain clean build
- run: cd $GITHUB_WORKSPACE ; ./mvnw clean verify
# # TODO: Publish docker images
# - run: cd $GITHUB_WORKSPACE ; docker build --no-cache -t daggerok/file-items-service -f ./linux-services/file-items-service/Dockerfile .
# - run: cd $GITHUB_WORKSPACE ; docker build --no-cache -t daggerok/file-server -f ./linux-services/file-server/Dockerfile .
# # TODO: Publish github release with assets and update back github pages documentation to use jars from github release
# - name: Deploy 🚀 GitHub Pages
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages # The branch the action should deploy to.
# folder: target/generated-docs # The folder the action should deploy.
## Create 'tagged' pre-release
- run: mkdir -p $GITHUB_WORKSPACE/dist
- run: cp -Rfv $GITHUB_WORKSPACE/build/libs/*.jar $GITHUB_WORKSPACE/build/libs/gradle-app.jar
- run: mv -f $GITHUB_WORKSPACE/build/libs/*.jar $GITHUB_WORKSPACE/dist/
- run: cp -Rfv $GITHUB_WORKSPACE/target/*.jar $GITHUB_WORKSPACE/target/maven-app.jar
- run: cp -Rfv $GITHUB_WORKSPACE/target/*.jar $GITHUB_WORKSPACE/dist/
- name: Set env variables
id: refs_names
run: |
echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- name: Get env variables
env:
SOURCE_NAME: ${{ steps.refs_names.outputs.SOURCE_NAME }}
SOURCE_BRANCH: ${{ steps.refs_names.outputs.SOURCE_BRANCH }}
SOURCE_TAG: ${{ steps.refs_names.outputs.SOURCE_TAG }}
run: |
echo $SOURCE_NAME
echo $SOURCE_BRANCH
echo $SOURCE_TAG
- uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Build ${{ steps.refs_names.outputs.SOURCE_TAG }}"
files: |
LICENSE.txt
dist/*.jar