-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (67 loc) · 2.17 KB
/
ci_release.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: CI and Release
on:
push:
# Pending full e2e testing
#schedule:
# Run daily at 1:15am
#- cron: "15 1 * * *"
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
version:
# Friendly description to be shown in the UI instead of 'name'
description: "Semver type of new version (major / minor / patch)"
# Input has to be provided for the workflow to run
required: true
type: choice
options:
- patch
- minor
- major
jobs:
# Run the linting
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Yamllint
uses: SkynetLabs/.github/.github/actions/yamllint@master
syntax_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check playbooks with --syntax-check
run: make syntax-check
ansible-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint Ansible Playbook
uses: ansible/[email protected]
# Check if there were any changes since the last tag if this isn't a push
# event
changes:
needs: [yamllint, syntax_check, ansible-lint]
runs-on: ubuntu-latest
outputs:
updates: ${{steps.changes.outputs.any == 'true'}}
if: ${{ github.event_name != 'push' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags
- uses: SkynetLabs/.github/.github/actions/changes-since-last-tag@master
# Make a release if
# - there were changes and this is a scheduled job
# - This is a manually trigger job, i.e. workflow_dispatch
release:
needs: changes
runs-on: ubuntu-latest
if: ${{ (needs.changes.outputs.updates == 'true' && github.event_name == 'schedule') || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v2
- name: Version Release
uses: SkynetLabs/.github/.github/actions/version-release@master
with:
github-token: ${{secrets.GITHUB_TOKEN}}
version-bump: ${{inputs.version}}