-
-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (68 loc) · 2.41 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Release
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set current date as environment variable
run: echo "DATE=`date +'%Y.%m.%d'`" >>$GITHUB_ENV
- name: Building TCET Linux Welcome Tar file
run: |
cd ..
touch tcet-linux-wallpaper.tar.gz
tar -czf tcet-linux-wallpaper.tar.gz tcet-linux-wallpaper/
touch checksum
sha256sum tcet-linux-wallpaper.tar.gz > checksum
mv checksum tcet-linux-wallpaper/
mv tcet-linux-wallpaper.tar.gz tcet-linux-wallpaper/
- name: Checking if release with date tag exist
run: |
tag=${{ env.DATE }}
if gh release view $tag; then
echo "RELEASE_EXISTS=true" >> $GITHUB_ENV
else
echo "RELEASE_EXISTS=false" >> $GITHUB_ENV
fi
- name: Checking if release with latest tag exist
run: |
tag=latest
if gh release view $tag; then
echo "LATEST_RELEASE_EXISTS=true" >> $GITHUB_ENV
else
echo "LATEST_RELEASE_EXISTS=false" >> $GITHUB_ENV
fi
- name: Deleting Dated release
if: env.RELEASE_EXISTS == 'true'
run: |
gh release delete ${{ env.DATE }}
- name: Delete Previous Latest release
if: env.LATEST_RELEASE_EXISTS == 'true'
run: |
gh release delete latest
- name: Release Tar File
run: |
gh release create ${{ env.DATE }} *tar.gz checksum --title "TCET-Linux Wallpaper"
- name: Release Tar File with latest
run: |
gh release create latest *tar.gz checksum --latest --title "TCET-Linux Wallpaper"
- name: Triggered PKGBUILD Action
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.PAT_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/tcet-opensource/tcet-linux-pkgbuild/dispatches \
-d '{"event_type":"trigger-workflow","client_payload":{"unit":false,"integration":true}}'