generated from VeeamHub/veeamhub-template
-
Notifications
You must be signed in to change notification settings - Fork 19
33 lines (32 loc) · 1.36 KB
/
build-collection.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
name: Build Ansible Collection
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- uses: actions/checkout@v2
- name: Retrieving variables from galaxy.yml
run: |
echo "COLLECTION_NAMESPACE=`grep 'namespace:' galaxy.yml | tail -n1 | awk '{ print $2}' | tr -d \\"`" >> $GITHUB_ENV
echo "COLLECTION_NAME=`grep 'name:' galaxy.yml | tail -n1 | awk '{ print $2}' | tr -d \\"`" >> $GITHUB_ENV
echo "VERSION=`grep 'version:' galaxy.yml | tail -n1 | awk '{ print $2}' | tr -d \\"`" >> $GITHUB_ENV
- name: Printing Ansible version & custom variables
run: |
ansible --version
echo $COLLECTION_NAMESPACE
echo $COLLECTION_NAME
echo $VERSION
# Building collection
- run: |
ansible-galaxy collection build
# Upload generated tar file as an artifact
- name: Retrieving additional environment variables
uses: FranzDiebold/[email protected]
- uses: actions/upload-artifact@v2
with:
name: ${{ env.COLLECTION_NAMESPACE }}-${{ env.COLLECTION_NAME }}-${{ env.VERSION }}-${{ env.CI_SHA_SHORT }}
path: |
${{ github.workspace }}/**/*.tar.gz