blob: 9f2c9baa6f4c6222c1c1528fce16a332034f29c6 [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
renovate[bot]38929d42024-01-02 11:18:18 -050014 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
Mohammed Naser7e6654a2022-09-21 17:48:03 -040015
16 - name: Build and publish collection
renovate[bot]38929d42024-01-02 11:18:18 -050017 uses: artis3n/ansible_galaxy_collection@3368f56529a2ef47ef0ac1ecfcda039f90d0174a # v2
Mohammed Naser7e6654a2022-09-21 17:48:03 -040018 with:
19 api_key: "${{ secrets.GALAXY_API_KEY }}"
20
21 - name: Get release
renovate[bot]38929d42024-01-02 11:18:18 -050022 uses: bruceadams/get-release@74c3d60f5a28f358ccf241a00c9021ea16f0569f # 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
renovate[bot]38929d42024-01-02 11:18:18 -050032 uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # 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