-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (44 loc) · 1.57 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
---
name: Release Ansible collection
on:
workflow_dispatch:
push:
tags:
- "*.*.*"
permissions:
contents: write
pull-requests: read
jobs:
release:
runs-on: [self-hosted, Linux, X64, ansible-collection]
if: github.repository == 'Sentinel-One/ansible_collection_s1agents'
strategy:
matrix:
versions:
# ansible-core upstream development supports 3 releases at a time
# https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html
- ansible: stable-2.16
python: "3.12"
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/ci-setup
with:
python-version: ${{ matrix.versions.python }}
ansible-version: ${{ matrix.versions.ansible }}
- name: Get version from galaxy.yml
id: collection-version
run: |
echo "RELEASE_TAG=$(grep '^version' galaxy.yml | awk '{ print $2 }')" >> $GITHUB_ENV
echo
- name: Build Ansible Collection
run: ansible-galaxy collection build
- name: Publish a release and attach collection
run: |
gh release create ${RELEASE_TAG} -F CHANGELOG.md --generate-notes --draft sentinelone-s1agents-${RELEASE_TAG}.tar.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
# - name: Deploy Ansible collection to Galaxy
# run: ansible-galaxy collection publish sentinelone-s1agents-${env.RELEASE_TAG}.tar.xz --api-key ${{ secrets.GALAXY_API_KEY }}