blob: cd8c43085a67b1eed5759554713a18a2f689e4e8 [file] [log] [blame]
Mohammed Naser7e6654a2022-09-21 17:48:03 -04001name: publish
2
3on:
4 release:
5 types:
6 - published
Oleksandr Kozachenko5c519cd2023-11-17 07:25:42 +01007 workflow_dispatch:
Mohammed Naser7e6654a2022-09-21 17:48:03 -04008
9jobs:
10 ansible-collection:
11 runs-on: ubuntu-latest
12 steps:
13 - name: Checkout project
dependabot[bot]804e8d22023-09-06 16:51:40 -040014 uses: actions/checkout@v4
Mohammed Naser7e6654a2022-09-21 17:48:03 -040015
16 - name: Build and publish collection
17 uses: artis3n/ansible_galaxy_collection@v2
18 with:
19 api_key: "${{ secrets.GALAXY_API_KEY }}"
20
21 - name: Get release
Mohammed Naser02132622023-02-03 04:25:20 +000022 uses: bruceadams/get-release@v1.3.2
Mohammed Naser7e6654a2022-09-21 17:48:03 -040023 id: get_release
24 env:
25 GITHUB_TOKEN: ${{ github.token }}
26
27 - name: Get file name for collection
28 id: get_filename
29 run: echo ::set-output name=filename::$(ls *.tar.gz)
30
31 - name: Upload release asset
Mohammed Naser88cb2762023-01-18 03:28:21 +000032 uses: actions/upload-release-asset@v1
Mohammed Naser7e6654a2022-09-21 17:48:03 -040033 env:
34 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 with:
36 upload_url: ${{ steps.get_release.outputs.upload_url }}
37 asset_path: ./${{ steps.get_filename.outputs.filename }}
38 asset_name: ${{ steps.get_filename.outputs.filename }}
39 asset_content_type: application/gzip