@@ -3,20 +3,47 @@ name: Release
3
3
on :
4
4
workflow_run :
5
5
workflows : [CI]
6
- branches : [main]
7
6
types : [completed]
8
7
9
8
jobs :
9
+ check :
10
+ runs-on : ubuntu-latest
11
+ if : ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_branch, 'v') }}
12
+ outputs :
13
+ status : ${{ steps.check.conclusion }}
14
+ steps :
15
+ - name : Checkout
16
+ uses : actions/checkout@v4
17
+ with :
18
+ fetch-tags : true
19
+ - id : check
20
+ name : Verify that the ref is a tag (and not just a branch starting with "v")
21
+ run : git show-ref --verify refs/tags/${{ github.event.workflow_run.head_branch }}
22
+
10
23
release :
11
24
runs-on : ubuntu-latest
12
- if : ${{ github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/tags/') }}
25
+ needs : check
26
+ if : needs.check.outputs.status == 'success'
13
27
steps :
14
28
- name : Checkout
15
29
uses : actions/checkout@v4
16
30
- uses : taiki-e/install-action@parse-changelog
17
31
- name : Generate Changelog
18
32
run : parse-changelog CHANGELOG.md > ${{ github.workspace }}-CHANGELOG.md
33
+ - name : Download JAR
34
+ uses : actions/download-artifact@v4
35
+ with :
36
+ name : jsonoid-discovery.jar
37
+ github-token : ${{ secrets.GH_PAT }}
38
+ run-id : ${{ github.event.workflow_run.id }}
39
+ - name : Make source archive
40
+ 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
19
41
- name : Release
20
42
uses : softprops/action-gh-release@v1
21
43
with :
22
44
body_path : ${{ github.workspace }}-CHANGELOG.md
45
+ files : |
46
+ jsonoid-discovery*.jar
47
+ jsonoid-discovery-*.tar.gz
48
+ fail_on_unmatched_files : true
49
+ tag_name : ${{ github.event.workflow_run.head_branch }}
0 commit comments