-
Notifications
You must be signed in to change notification settings - Fork 68
154 lines (128 loc) · 5.01 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: PortMaster Release
on:
push:
paths-ignore:
- '.github/**'
- 'README.md'
- '.gitignore'
branches:
- main
workflow_dispatch:
concurrency:
group: release # only 1 release at a time
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: env - better defaulting of env vars;
id: env
run: |
LARGE_FILE_REPOSITORY="${{ secrets.LARGE_FILE_REPOSITORY }}"
if [[ -z "$LARGE_FILE_REPOSITORY" ]]; then
LARGE_FILE_REPOSITORY="PortsMaster/PortMaster-Hosting"
fi
echo "LARGE_FILE_REPOSITORY=$LARGE_FILE_REPOSITORY" >> $GITHUB_OUTPUT
LARGE_FILE_TAG="${{ secrets.LARGE_FILE_TAG }}"
if [[ -z "$LARGE_FILE_TAG" ]]; then
LARGE_FILE_TAG="large-files"
fi
echo "LARGE_FILE_TAG=$LARGE_FILE_TAG" >> $GITHUB_OUTPUT
RUNTIME_REPOSITORY="${{ secrets.RUNTIME_REPOSITORY }}"
if [[ -z "$RUNTIME_REPOSITORY" ]]; then
RUNTIME_REPOSITORY="PortsMaster/PortMaster-Runtime"
fi
echo "RUNTIME_REPOSITORY=$RUNTIME_REPOSITORY" >> $GITHUB_OUTPUT
RUNTIME_TAG="${{ secrets.RUNTIME_TAG }}"
if [[ -z "$RUNTIME_TAG" ]]; then
RUNTIME_TAG="runtimes"
fi
echo "RUNTIME_TAG=$RUNTIME_TAG" >> $GITHUB_OUTPUT
RELEASE_REPO="${{ secrets.RELEASE_REPO }}"
if [[ -z "$RELEASE_REPO" ]]; then
RELEASE_REPO="PortMaster-Releases"
fi
echo "RELEASE_REPO=$RELEASE_REPO" >> $GITHUB_OUTPUT
RELEASE_ORG="${{ secrets.RELEASE_ORG }}"
if [[ -z "$RELEASE_ORG" ]]; then
RELEASE_ORG="PortsMaster"
fi
echo "RELEASE_ORG=$RELEASE_ORG" >> $GITHUB_OUTPUT
PMGUI_REPOSITORY="${{ secrets.PMGUI_REPOSITORY }}"
if [[ -z "$PMGUI_REPOSITORY" ]]; then
PMGUI_REPOSITORY="PortsMaster/PortMaster-GUI"
fi
echo "PMGUI_REPOSITORY=$PMGUI_REPOSITORY" >> $GITHUB_OUTPUT
- uses: hmarr/debug-action@v2
name: "debug: ${{github.event_name}}"
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: robinraju/[email protected]
with:
repository: "${{ steps.env.outputs.LARGE_FILE_REPOSITORY }}"
tag: "${{ steps.env.outputs.LARGE_FILE_TAG }}"
fileName: "*"
- uses: robinraju/[email protected]
with:
repository: "${{ steps.env.outputs.RUNTIME_REPOSITORY }}"
tag: "${{ steps.env.outputs.RUNTIME_TAG }}"
fileName: "*"
- name: Remove Zulu JDK
id: runtimes-zip
run: |
rm -f zulu*
- name: Get release name for artifacts
id: date
run: |
echo "date=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get PMGUI_RELEASE_ID
id: releaseid
run: |
echo "PMGUI_RELEASE_ID=$(cat PMGUI_RELEASE.txt)" >> $GITHUB_OUTPUT
- uses: robinraju/[email protected]
with:
repository: "${{ steps.env.outputs.PMGUI_REPOSITORY }}"
tag: "${{ steps.releaseid.outputs.PMGUI_RELEASE_ID }}"
fileName: "*"
- name: Create images zip from images Folder
id: images-zip
run: |
find images \( -iname '*.jpg' -o -iname '*.png' \) -exec touch -d '2021-01-01 00:00:00' {} \;
find images \( -iname '*.jpg' -o -iname '*.png' \) -exec chmod 644 {} \;
find images \( -iname '*.jpg' -o -iname '*.png' \) | sort | TZ=UTC zip -qX images.zip -@
- name: Generate Port Files.
id: ports-info
run: |
rm -fv Install*PortMaster.sh
rm -fv *.md5
python3 tools/ports_json.py "${{steps.date.outputs.date}}"
- 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: "ports.md, ports.json, ports_status.json, *.zip, version, *.squashfs, *.md5"
token: ${{ secrets.PORTMASTER_RELEASE_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.PORTMASTER_RELEASE_TOKEN }}
repo: ${{ steps.env.outputs.RELEASE_REPO }}
owner: ${{ steps.env.outputs.RELEASE_ORG }}
- 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}}"