-
-
Notifications
You must be signed in to change notification settings - Fork 105
129 lines (107 loc) · 3.83 KB
/
release.yaml
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: PortMaster Release
on:
# We only run manually
workflow_dispatch:
concurrency:
group: release # only 1 release at a time
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: hmarr/debug-action@v2
name: "debug: ${{github.event_name}}"
- name: Clean out files part 1
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- name: Clean out files part 2
run: |
rm -rf .git
echo "Free Space"
df -h
- name: env - better defaulting of env vars;
id: env
run: |
source SOURCE_SETUP.txt
if [[ -z "$RELEASE_ORG" ]]; then
echo "::error file=SOURCE_SETUP.txt,line=2::Missing RELEASE_ORG, please configure"
exit 255
fi
echo "RELEASE_ORG=$RELEASE_ORG" >> $GITHUB_OUTPUT
if [[ -z "$RELEASE_REPO" ]]; then
echo "::error file=SOURCE_SETUP.txt,line=5::Missing RELEASE_REPO, please configure"
exit 255
fi
echo "RELEASE_REPO=$RELEASE_REPO" >> $GITHUB_OUTPUT
echo "PMGUI_RELEASE=$PMGUI_RELEASE" >> $GITHUB_OUTPUT
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: robinraju/[email protected]
with:
repository: ${{ github.repository }}
latest: true
out-file-path: "releases"
fileName: "*.json"
- uses: robinraju/[email protected]
with:
repository: ${{ github.repository }}
latest: true
out-file-path: "releases"
fileName: "images.zip"
######################################################################
## Only run these if it is the PortMaster-New repo
- uses: robinraju/[email protected]
if: ${{ steps.env.outputs.RELEASE_REPO }} == "PortMaster-New"
with:
out-file-path: "releases"
repository: "PortsMaster/PortMaster-GUI"
tag: "${{ steps.env.outputs.PMGUI_RELEASE }}"
fileName: "PortMaster.zip"
######################################################################
- name: Get release name for artifacts
id: date
run: |
echo "date=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_OUTPUT
- name: Generate Port Files.
id: ports-info
run: |
touch .github_check
python3 tools/build_data.py
python3 tools/build_release.py "${{steps.date.outputs.date}}"
rm -fv releases/.gitignore
- name: "Prepare Release"
uses: ncipollo/release-action@v1
with:
tag: "${{steps.date.outputs.date}}"
allowUpdates: true
draft: true
prerelease: false
replacesArtifacts: false
omitNameDuringUpdate: true
artifacts: "releases/*"
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO }}
owner: ${{ steps.env.outputs.RELEASE_ORG }}
- name: "Publish Release"
uses: ncipollo/release-action@v1
with:
tag: "${{steps.date.outputs.date}}"
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
allowUpdates: true
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO }}
owner: ${{ steps.env.outputs.RELEASE_ORG }}
- name: Check Free Space
run: |
df -h
- name: Release Info
id: info
run: |
echo "Published release: ${{steps.date.outputs.date}} to: https://github.com/${{ steps.env.outputs.RELEASE_ORG}}/${{ steps.env.outputs.RELEASE_REPO}}"