Skip to content

Commit 084fbba

Browse files
authored
Merge 9160788 into c78dcb7
2 parents c78dcb7 + 9160788 commit 084fbba

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed

.github/workflows/pre-release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Pre-Release
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- labeled
10+
- unlabeled
11+
12+
jobs:
13+
14+
generate-version:
15+
name: Generate version
16+
runs-on: ubuntu-latest
17+
18+
outputs:
19+
version: ${{ steps.out.outputs.version }}
20+
plain-version: ${{ steps.out.outputs.plain-version }}
21+
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- id: bump
26+
uses: zwaldowski/match-label-action@v1
27+
with:
28+
allowed: major,minor,patch
29+
30+
- uses: zwaldowski/semver-release-action@v2
31+
with:
32+
dry_run: true
33+
bump: ${{ steps.bump.outputs.match }}
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Get PR Number
37+
id: pr_number
38+
run: echo "::set-output name=nr::$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')"
39+
40+
- name: Set version output
41+
id: out
42+
run: |
43+
echo "::set-output name=version::$(echo ${VERSION}-PRE-${{ steps.pr_number.outputs.nr }})"
44+
echo "::set-output name=plain-version::$(echo ${VERSION})"
45+
46+
47+
git-release:
48+
needs: ["generate-version"]
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
53+
- uses: actions/checkout@v2
54+
55+
- uses: "marvinpinto/action-automatic-releases@latest"
56+
with:
57+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
58+
automatic_release_tag: ${{ needs.generate-version.outputs.version }}
59+
prerelease: true
60+
title: ${{ needs.generate-version.outputs.version }}

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
10+
generate-version:
11+
name: Generate version
12+
runs-on: ubuntu-latest
13+
14+
outputs:
15+
version: ${{ steps.out.outputs.version }}
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- id: pr
21+
uses: actions-ecosystem/[email protected]
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- uses: zwaldowski/semver-release-action@v2
26+
with:
27+
dry_run: true
28+
bump: ${{ steps.pr.outputs.labels }}
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Set version output
32+
id: out
33+
run: echo "::set-output name=version::$(echo ${VERSION})"
34+
35+
36+
git-release:
37+
name: Git Release
38+
needs: ["generate-version"]
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
43+
- uses: actions/checkout@v2
44+
45+
- uses: "marvinpinto/action-automatic-releases@latest"
46+
with:
47+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
48+
automatic_release_tag: ${{ needs.generate-version.outputs.version }}
49+
title: ${{ needs.generate-version.outputs.version }}
50+
prerelease: false

0 commit comments

Comments
 (0)