Debian Codegraph @

ansible_collections/community/mongodb/.github/workflows/publish_collection.yml

raw
1 name: Build & Publish Collection
2 on:
3 push:
4 branches:
5 - master
6
7 jobs:
8 build_publish:
9
10 runs-on: ubuntu-24.04
11 defaults:
12 run:
13 working-directory: ansible_collections/community/mongodb
14 steps:
15
16 - name: Check out code
17 uses: actions/checkout@v4
18 with:
19 path: ansible_collections/community/mongodb
20
21 - name: Set up Python 3.12
22 uses: actions/setup-python@v5
23 with:
24 python-version: "3.12"
25
26 - name: Install ansible-base (devel)
27 run: pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check
28
29 - name: Build the collection
30 run: ansible-galaxy collection build
31
32 - name: Rename the build artifact
33 run: mv community-mongodb-*.tar.gz community-mongodb-latest.tar.gz
34
35 - name: Upload community-mongodb-latest.tar.gz as an artifact
36 uses: actions/upload-artifact@v4
37 with:
38 name: community-mongodb-latest
39 path: ansible_collections/community/mongodb/community-mongodb-latest.tar.gz
40
41 # Moving the tag leaves an orphan artifact. Just changing the artifact doesn't move the tag.
42 - name: Delete latest tag and release
43 uses: dev-drprasad/[email protected]
44 with:
45 delete_release: true
46 tag_name: latest
47 env:
48 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
50 - name: Upload files to release
51 uses: svenstaro/upload-release-action@v2
52 with:
53 repo_token: ${{ secrets.GITHUB_TOKEN }}
54 file: ansible_collections/community/mongodb/community-mongodb-latest.tar.gz
55 asset_name: community-mongodb-latest.tar.gz
56 body: "Development release"
57 tag: latest
58 overwrite: true