-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.34 KB
/
build.yaml
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
name: Build and deploy
on: [ push ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew build
release:
name: Create Release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'ci skip')
steps:
- uses: actions/checkout@v4
- name: Set release tag
run: |
export TAG_NAME="$(TZ="Europe/Oslo" date +%Y.%m.%d-%H.%M).$(echo $GITHUB_SHA | cut -c 1-12)"
echo "RELEASE_TAG=$TAG_NAME" >> $GITHUB_ENV
- name: Set changelog
id: changelog
# (Escape newlines see https://github.com/actions/create-release/issues/25)
run: |
text="$(git --no-pager log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")"
echo "CHANGELOG=$text" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_TAG }}
body: |
Changes in this Release
${{ env.CHANGELOG }}"
draft: false
prerelease: false