-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.49 KB
/
ci-init.yml
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
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
name: ci repo initializer
'on':
# every day at midnight
schedule:
- cron: 0 0 * * 0
# on demand
workflow_dispatch: null
workflow_call:
inputs:
artifact_name:
description: name of the artifact to use
required: false
type: string
default: source-code
artifact_upload:
description: upload artifact
required: false
type: boolean
default: true
runs-on:
description: Select github runner based on labels, default is "['ubuntu-latest']"
required: false
type: string
default: "['ubuntu-latest']"
outputs:
version:
description: Semantic version of the repository, based on the privious tag
value: ${{ jobs.init.outputs.version }}
artifact:
description: name of the artifact
value: ${{ inputs.artifact_name }}
permissions:
contents: read
jobs:
init:
name: setup artifacts and version
runs-on: ${{ fromJson(inputs.runs-on) }}
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: get version
id: version
run: |
echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
if: ${{ inputs.artifact_upload }}
with:
name: ${{ inputs.artifact_name }}
path: ./