-
Notifications
You must be signed in to change notification settings - Fork 34
36 lines (31 loc) · 972 Bytes
/
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
---
name: Publish releases
permissions:
contents: write
on:
create:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
container:
image: python:3.11-alpine
steps:
- name: checkout
uses: actions/checkout@v4
- name: Publish collection to ansible galaxy
env:
GALAXY_API_KEY: "${{ secrets.galaxy_api_key }}"
run: |
set -ex
apk add --update --no-cache --virtual build_dependencies gcc musl-dev libffi-dev openssl-dev rust cargo
pip install --no-cache-dir ansible-core
sed -i "s/0.0.0/${GITHUB_REF_NAME/v/}/" galaxy.yml
ansible-galaxy collection build --output-path ./build
ansible-galaxy collection publish --token ${GALAXY_API_KEY} $(find ./build/ -type f)
- name: Release to github
uses: softprops/action-gh-release@v1
with:
files: ./build
generate_release_notes: true