-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (44 loc) · 1.33 KB
/
main.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
name: Release (Github Package Registry)
on:
pull_request:
types:
- closed
branches:
- 'main'
paths-ignore:
- '.github/dependabot.yml'
env:
IMAGE: ghcr.io/${{ github.repository }}/klage-kodeverk:${{ github.sha }}
jobs:
release:
if: github.event.pull_request.merged == true
name: Create Release
permissions:
contents: write
packages: write
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
name: Checkout
- id: bump
uses: zwaldowski/match-label-action@main
with:
allowed: major,minor,patch
- id: next_version
uses: zwaldowski/semver-release-action@main
name: Prepare and tag release with semver
with:
bump: ${{ steps.bump.outputs.match }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: upload artifact
run: ./gradlew -Pversion="$(echo ${{steps.next_version.outputs.version_tag}})" publish
env:
GITHUB_USERNAME: x-access-token
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{steps.next_version.outputs.version_tag}}
release_name: v${{steps.next_version.outputs.version_tag}}