-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.85 KB
/
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
name: Release
on: # yamllint disable-line rule:truthy
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'd-strobel/ansible-collection-windows'
strategy:
matrix:
python-version: [3.8]
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get release version
id: version
run: |
RELEASE=$(grep version galaxy.yml | awk -F'"' '{ print $2 }')
echo "Release version: $RELEASE"
echo "release=$RELEASE" >> "$GITHUB_OUTPUT"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade ansible
- name: Copy files and directories to source
run: |
mkdir -p build/src
cp $files build/src
cp -rf $directories build/src
env:
files: "README.md LICENSE galaxy.yml"
directories: "plugins meta"
- name: Build Ansible Collection
run: ansible-galaxy collection build build/src --force
- name: Create release
uses: ncipollo/release-action@v1
with:
name: v${{ steps.version.outputs.release }}
tag: v${{ steps.version.outputs.release }}
artifacts: d_strobel-windows-${{ steps.version.outputs.release }}.tar.gz
draft: false
prerelease: false
body: |
# ${{ steps.version.outputs.release }}
generateReleaseNotes: true
- name: Deploy Ansible collection to Galaxy
run: ansible-galaxy collection publish d_strobel-windows-${{ steps.version.outputs.release }}.tar.gz --api-key ${{ secrets.GALAXY_API_KEY }}