-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (48 loc) · 1.4 KB
/
release.yaml
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
on:
workflow_call:
inputs:
service-name:
required: true
type: string
version:
required: true
type: string
change-notes:
required: true
type: string
license-artifact-name:
required: false
type: string
license-artifact-path:
required: false
type: string
jobs:
release:
name: 🎉 Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && inputs.version != 'dev'
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 📦 Download license artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.license-artifact-name }}
path: ${{ inputs.license-artifact-path }}
- name: 🏷 Tag repository
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ inputs.service-name }}-v${{ inputs.version }}',
sha: context.sha
})
- name: 🚀 Release
uses: softprops/action-gh-release@v1
with:
body: ${{ inputs.change-notes }}
fail_on_unmatched_files: false
files: ${{ inputs.license-artifact-path }}/*
tag_name: ${{ inputs.service-name }}-v${{ inputs.version }}