-
Notifications
You must be signed in to change notification settings - Fork 3
97 lines (83 loc) · 2.96 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
name: release
on:
push:
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: |
RELEASE_REPO="${{ secrets.RELEASE_REPO }}"
if [[ -z "$RELEASE_REPO" ]]; then
RELEASE_REPO="PortMaster-Themes"
fi
echo "::set-output name=RELEASE_REPO::$RELEASE_REPO"
RELEASE_ORG="${{ secrets.RELEASE_ORG }}"
if [[ -z "$RELEASE_ORG" ]]; then
RELEASE_ORG="PortsMaster"
fi
echo "::set-output name=RELEASE_ORG::$RELEASE_ORG"
- uses: hmarr/debug-action@v2
name: "debug: ${{github.event_name}}"
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Get release name for artifacts
id: date
run: |
echo "::set-output name=date::$(date +'%Y-%m-%d_%H%M')"
- name: Collate theme data.
id: theme-info
run: |
python3 themes.py
- name: Create images zip from theme screenshots
id: images-zip
run: |
find . \( -iname '*.screenshot.jpg' -o -iname '*.screenshot.png' \) -exec touch -d '2021-01-01 00:00:00' {} \;
find . \( -iname '*.screenshot.jpg' -o -iname '*.screenshot.png' \) -exec chmod 644 {} \;
find . \( -iname '*.screenshot.jpg' -o -iname '*.screenshot.png' \) | sort | TZ=UTC zip -qX images.zip -@
- name: Create md5 hashes
id: md5
run: |
for file in *.zip; do
if [ ! -f "$file" ]; then
continue
fi
echo "file: $file"
md5sum "$file" | cut -f1 -d' ' > "$file.md5"
done
- 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: "*.json, *.zip, *.md5"
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: 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}}"