-
Notifications
You must be signed in to change notification settings - Fork 7
68 lines (60 loc) · 2.03 KB
/
update-files-manifest.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
name: Update Files Manifest
on:
push:
branches:
- main
- master
workflow_dispatch:
jobs:
update-manifest:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]' && github.actor != 'github-actions'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.PAT }}
fetch-depth: 1
sparse-checkout: |
files_manifest.json
metadata.json
אוצריא/**/*
links/**/*
sparse-checkout-cone-mode: false
- name: Generate Files Manifest
run: |
echo "{" > files_manifest.json
find . \( -path "./metadata.json" -o -path "./אוצריא/*" -o -path "./links/*" \) -type f \
! -path "./.git/*" \
! -path "./.github/*" \
! -name "files_manifest.json" \
-exec sh -c '
path="${1#./}"
hash=$(sha256sum "$1" | cut -d" " -f1)
echo "\"$path\": {\"hash\": \"$hash\"}"
' sh {} \; | sed "$ ! s/$/,/" >> files_manifest.json
echo "}" >> files_manifest.json
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: "files_manifest.json"
message: "Update files manifest"
default_author: github_actions
- name: Create Release Archive
run: |
zip -r otzaria_latest.zip אוצריא links files_manifest.json metadata.json
- name: Delete existing 'latest' release and tag
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
gh release delete latest --yes || true
git push --delete origin latest || true
- name: Create Release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
gh release create latest \
--title "Latest Otzaria Files" \
--notes "Latest version of Otzaria files" \
otzaria_latest.zip