-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (50 loc) · 1.66 KB
/
releasezip.yml
File metadata and controls
61 lines (50 loc) · 1.66 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
name: Generate and Upload Zip Files
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v4
# Set up Python environment
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.11'
# Install any necessary Python dependencies (e.g., if you use any non-standard libraries)
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install preflibtools
# Run your Python script to generate the zip files
- name: Run zip generation script
run: |
cd scripts
python zipall.py
# Install GitHub CLI
- name: Install GitHub CLI
run: |
sudo apt-get install gh
# Remove existing release assets
- name: Remove existing release assets
run: |
# Get the list of assets for the release
assets=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/PrefLib/PrefLib-Data/releases/tags/v1.0 | jq -r '.assets[] | .id')
# Loop through each asset ID and delete it
for asset_id in $assets; do
curl -X DELETE -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/PrefLib/PrefLib-Data/releases/assets/$asset_id
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload files to release
- name: Upload ZIP files to Release
run: |
for file in zip/*.zip; do
gh release upload v1.0 "$file" --clobber
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}