-
-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (124 loc) · 3.86 KB
/
push.yml
File metadata and controls
139 lines (124 loc) · 3.86 KB
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
name: Add/Remove Packages
on:
push:
branches:
- master
permissions:
packages: write
contents: write
concurrency:
group: "release"
jobs:
variables:
runs-on: ubuntu-latest
outputs:
enc-gpg: ${{ steps.config.outputs.enc-gpg }}
repo-name: ${{ steps.config.outputs.repo-name }}
packager: ${{ steps.config.outputs.packager }}
deleted: ${{ steps.deleted-files.outputs.deleted_files }}
added: ${{ steps.added-files.outputs.added_files }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- id: config
uses: ./.github/actions/load-config
- name: Get deleted files
id: deleted-files
uses: tj-actions/changed-files@v47
with:
files_ignore: .github/**
json: true
json_raw_format: true
- run: echo ${{ steps.deleted-files.outputs.deleted_files }}
- run: echo ${{ steps.deleted-files.outputs.other_deleted_files }}
- name: Get added files
id: added-files
uses: tj-actions/changed-files@v47
with:
files_ignore: .github/**
dir_names: true
dir_names_max_depth: 1
dir_names_exclude_root: true
json: true
json_raw_format: true
- run: echo ${{ steps.added-files.outputs.deleted_files }}
- run: echo ${{ steps.added-files.outputs.other_deleted_files }}
added:
runs-on: ubuntu-latest
needs: variables
if: ${{ needs.variables.outputs.added != '[]' }}
strategy:
matrix:
package: ${{ fromJson(needs.variables.outputs.added) }}
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Build ${{ matrix.package }}
uses: ./.github/actions/archlinux
env:
PACKAGER: ${{ needs.variables.outputs.packager }}
SECRET: ${{ secrets.ENCRYPTION_KEY }}
GPGKEY: ${{ needs.variables.outputs.enc-gpg }}
with:
dir: ${{ matrix.package }}
run: makepkg -sr --sign -C -c --noconfirm --noprogressbar
- name: Upload new package ${{ matrix.package }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: repository
file: ${{ matrix.package }}/*.pkg.*
file_glob: true
overwrite: false
deleted:
runs-on: ubuntu-latest
needs: variables
if: ${{ needs.variables.outputs.deleted != '[]' }}
strategy:
matrix:
package: ${{ fromJson(needs.variables.outputs.deleted) }}
steps:
- name: Delete old package ${{ matrix.package }}
uses: mknejp/delete-release-assets@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: repository
assets: ${{ matrix.package }}*
build-repo:
runs-on: ubuntu-latest
needs:
- added
- deleted
- variables
if: always() && (needs.variables.outputs.deleted != '[]' || needs.variables.outputs.added != '[]')
steps:
- uses: actions/checkout@v6
with:
ref: master
- name: Get current packages
uses: robinraju/release-downloader@v1.12
with:
latest: true
fileName: '*.pkg.*'
tarBall: false
zipBall: false
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Repo
uses: ./.github/actions/archlinux
env:
PACKAGER: ${{ needs.variables.outputs.packager }}
SECRET: ${{ secrets.ENCRYPTION_KEY }}
GPGKEY: ${{ needs.variables.outputs.enc-gpg }}
with:
run: repo-add -s -q --nocolor -n -R ${{ needs.variables.outputs.repo-name }}.db.tar.gz *.pkg.tar.zst
- name: Upload new repo
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: repository
file: ${{ needs.variables.outputs.repo-name }}.db*
file_glob: true
overwrite: true