forked from Sibz/github-status-action
-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (65 loc) · 2.29 KB
/
ci.yml
File metadata and controls
74 lines (65 loc) · 2.29 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Create release
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
create_release:
name: Create release
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: dorny/paths-filter@v4
id: changes
with:
filters: |
dist:
- "dist/**"
- "action.yml"
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.5.0
with:
versionSpec: "6.x"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v4.5.0
- name: Create Release (tag) - fullSemVer
id: create_release
if: ${{ steps.changes.outputs.dist == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ncipollo/release-action@v1.21.0
with:
allowUpdates: false
skipIfReleaseExists: true
draft: false
makeLatest: true
tag: v${{ steps.gitversion.outputs.semVer }}
name: Release v${{ steps.gitversion.outputs.semVer }}
generateReleaseNotes: true
body:
Release ${{ steps.gitversion.outputs.semVer }} of ${{ github.event.repository.name }}
- name: Create Release (tag) - major version
if: ${{ steps.changes.outputs.dist == 'true' || github.event_name == 'workflow_dispatch' }}
uses: ncipollo/release-action@v1.21.0
with:
allowUpdates: true
skipIfReleaseExists: false
draft: false
makeLatest: false
tag: v${{ steps.gitversion.outputs.major }}
name: Release v${{ steps.gitversion.outputs.major }}
generateReleaseNotes: true
body:
Release ${{ steps.gitversion.outputs.major }} of ${{ github.event.repository.name }}
- name: Update latest tag
if: ${{ steps.create_release.outputs.id != '' }}
run: |
RELEASE_TAG="v${{ steps.gitversion.outputs.semVer }}"
git fetch origin "refs/tags/${RELEASE_TAG}:refs/tags/${RELEASE_TAG}"
git tag --force latest "$RELEASE_TAG"
git push origin refs/tags/latest:refs/tags/latest --force