diff --git a/.github/workflows/build-galaxy-collection.yml b/.github/workflows/build-galaxy-collection.yml new file mode 100644 index 00000000..1a18718d --- /dev/null +++ b/.github/workflows/build-galaxy-collection.yml @@ -0,0 +1,37 @@ +--- + +name: Build Ansible Galaxy Collection +on: + release: + types: [published] + +jobs: + build-and-upload: + name: Build Collection Tarball and Upload to Release + runs-on: ubuntu-latest + permissions: + contents: rwrited + packages: write + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Setup Pixi + uses: prefix-dev/setup-pixi@8ca4608ef7f4daeb54f5205b20d0b7cb42f11143 # yamllint disable-line rule:line-length + with: + pixi-version: v0.55.0 + cache: false + frozen: true + + - name: Run ansible galaxy collection build + run: | + pixi run ansible-galaxy collection build --output-path dist + + - name: Upload tarball to GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload ${{ github.event.release.tag_name }} dist/*.tar.gz --clobber diff --git a/.gitignore b/.gitignore index e6ec890e..64b3fc2e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ __pycache__/ .ansible/ .pixi/ ansible_collections/ +*.tar.gz