Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 1 | name: publish |
| 2 | |
| 3 | on: |
| 4 | release: |
| 5 | types: |
| 6 | - published |
| 7 | |
| 8 | jobs: |
| 9 | ansible-collection: |
| 10 | runs-on: ubuntu-latest |
| 11 | steps: |
| 12 | - name: Checkout project |
dependabot[bot] | 804e8d2 | 2023-09-06 16:51:40 -0400 | [diff] [blame] | 13 | uses: actions/checkout@v4 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 14 | |
| 15 | - name: Build and publish collection |
| 16 | uses: artis3n/ansible_galaxy_collection@v2 |
| 17 | with: |
| 18 | api_key: "${{ secrets.GALAXY_API_KEY }}" |
| 19 | |
| 20 | - name: Get release |
Mohammed Naser | 0213262 | 2023-02-03 04:25:20 +0000 | [diff] [blame] | 21 | uses: bruceadams/get-release@v1.3.2 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 22 | id: get_release |
| 23 | env: |
| 24 | GITHUB_TOKEN: ${{ github.token }} |
| 25 | |
| 26 | - name: Get file name for collection |
| 27 | id: get_filename |
| 28 | run: echo ::set-output name=filename::$(ls *.tar.gz) |
| 29 | |
| 30 | - name: Upload release asset |
Mohammed Naser | 88cb276 | 2023-01-18 03:28:21 +0000 | [diff] [blame] | 31 | uses: actions/upload-release-asset@v1 |
Mohammed Naser | 7e6654a | 2022-09-21 17:48:03 -0400 | [diff] [blame] | 32 | env: |
| 33 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 34 | with: |
| 35 | upload_url: ${{ steps.get_release.outputs.upload_url }} |
| 36 | asset_path: ./${{ steps.get_filename.outputs.filename }} |
| 37 | asset_name: ${{ steps.get_filename.outputs.filename }} |
| 38 | asset_content_type: application/gzip |