forked from bombsquad-community/plugin-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.98 KB
/
release.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
name: Create Release
on:
push:
branches:
- main
paths:
- index.json
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: 'Get Previous tag'
uses: oprypin/[email protected]
with:
repository: ${{ github.repository }}
releases-only: true # We know that all relevant tags have a GitHub release for them.
id: previoustag
- name: set_variables
run: |
output1=$(python3 test/get_latest.py get_latest_version)
{
echo "changelog<<EOF"
python3 test/get_changes.py "$(python3 test/get_latest.py get_latest_version)"
echo EOF
} >> "$GITHUB_OUTPUT"
output2=$(python3 test/get_latest.py get_latest_api)
output3=$(python3 test/version_is_lower.py ${{ steps.previoustag.outputs.tag }})
echo "latestVersion=$output1" >> $GITHUB_OUTPUT
echo "latestAPI=$output2" >> $GITHUB_OUTPUT
echo "shouldRun=$output3" >> $GITHUB_OUTPUT
id: set_variables
- name: Bump version and push tag
if: ${{ steps.set_variables.outputs.shouldRun == '1' }}
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: |
${{ steps.set_variables.outputs.latestVersion }}
- name: Create release
if: ${{ steps.tag_version.outputs.new_tag }}
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }} (api ${{ steps.set_variables.outputs.latestAPI }})
artifacts: "plugin_manager.py"
body: |
## Changelog
${{ steps.set_variables.outputs.changelog }}