forked from saltstack/salt
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (70 loc) · 2.48 KB
/
release-tag.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Generate Tag and Github Release
on:
workflow_dispatch:
inputs:
saltVersion:
description: 'Salt Version'
required: true
saltRepo:
description: 'Salt Repo'
default: saltstack/salt
saltBranch:
description: 'Salt Branch'
default: freeze
reTag:
description: 'Re Tag (Deletes tag and release)'
default: false
permissions:
contents: read
jobs:
GenerateTagRelease:
permissions:
contents: write # for dev-drprasad/delete-tag-and-release to delete tags or releases
name: Generate Tag and Github Release
runs-on: ubuntu-latest
steps:
- uses: dev-drprasad/[email protected]
if: github.event.inputs.reTag == 'true'
with:
delete_release: true # default: false
tag_name: v${{ github.event.inputs.saltVersion }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.saltRepo }}
ref: ${{ github.event.inputs.saltBranch }}
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
create_annotated_tag: True
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ github.event.inputs.saltVersion }}
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- uses: actions/checkout@v2
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
git fetch --tags origin
git checkout v${{ github.event.inputs.saltVersion }}
chmod 700 conf/cloud.*.d
chmod 600 conf/cloud
chmod 600 conf/cloud.profiles
chmod 600 conf/cloud.providers
python3 setup.py --ssh-packaging sdist
python -m build --sdist --outdir dist/ .
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: |
WARNING: The tarball generated by GitHub will not have the correct version information when using a version not ending in .0 . Please use the tarball generated by SaltStack instead. See issue #41847 for more information.
Official Salt packages can be found at https://repo.saltproject.io/
artifacts: dist/salt*.tar.gz