-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (56 loc) · 1.51 KB
/
artifact-release.yml
File metadata and controls
57 lines (56 loc) · 1.51 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
on:
workflow_call:
inputs:
tag_name:
required: true
type: string
release_name:
required: true
type: string
run_id:
required: true
type: string
artifact_pattern:
required: false
type: string
default: ''
jobs:
artifact-release:
name: Release with Artifacts
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
permissions:
contents: write
steps:
- name: Fetch Artifact
uses: actions/download-artifact@v5
with:
run-id: ${{inputs.run_id}}
merge-multiple: true
pattern: ${{inputs.artifact_pattern}}
- name: Update Tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{inputs.tag_name}}',
sha: context.sha
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/${{inputs.tag_name}}',
sha: context.sha
});
})
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
name: ${{inputs.release_name}}
tag_name: ${{inputs.tag_name}}
body: "TBD"
files: ./*
make_latest: false