-
Notifications
You must be signed in to change notification settings - Fork 5
52 lines (49 loc) · 1.8 KB
/
Copy pathcreate-release.yml
File metadata and controls
52 lines (49 loc) · 1.8 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
name: Release
on:
workflow_run:
workflows: [CI]
types: [completed]
jobs:
check:
runs-on: blacksmith-2vcpu-ubuntu-2404
if: ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v') }}
outputs:
status: ${{ steps.check.conclusion }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-tags: true
persist-credentials: false
- id: check
name: Verify that the ref is a tag (and not just a branch starting with "v")
run: git show-ref --verify refs/tags/${{ github.event.workflow_run.head_branch }}
release:
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: check
if: needs.check.outputs.status == 'success'
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- uses: taiki-e/install-action@parse-changelog
- name: Generate Changelog
run: parse-changelog CHANGELOG.md > ${{ github.workspace }}-CHANGELOG.md
- name: Download JAR
uses: actions/download-artifact@v6
with:
name: jsonoid-discovery.jar
github-token: ${{ secrets.GH_PAT }}
run-id: ${{ github.event.workflow_run.id }}
- name: Make source archive
run: git archive --format tar.gz --prefix=jsonoid-discovery-${{ github.event.workflow_run.head_branch }}/ HEAD > jsonoid-discovery-${{ github.event.workflow_run.head_branch }}.tar.gz
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: ${{ github.workspace }}-CHANGELOG.md
files: |
jsonoid-discovery*.jar
jsonoid-discovery-*.tar.gz
fail_on_unmatched_files: true
tag_name: ${{ github.event.workflow_run.head_branch }}