Release #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |