mirror of
https://github.com/UberGuidoZ/Flipper.git
synced 2025-06-20 15:14:49 +00:00
Compare commits
6 Commits
6fe81b7c5e
...
5572b35914
Author | SHA1 | Date | |
---|---|---|---|
|
5572b35914 | ||
|
37e6dc6c3e | ||
|
3732ed9009 | ||
|
7f94151934 | ||
|
f9865e9c10 | ||
|
9e1029519a |
69
.github/workflows/Snapshot.yml
vendored
Normal file
69
.github/workflows/Snapshot.yml
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
name: Monthly Snapshot
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st of every month
|
||||
|
||||
jobs:
|
||||
snapshot:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo with submodules
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Set date variables
|
||||
id: date
|
||||
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Install zstd/rsync
|
||||
run: sudo apt-get update && sudo apt-get install -y zstd rsync
|
||||
|
||||
- name: Create a temporary directory for snapshot
|
||||
run: |
|
||||
mkdir -p /tmp/snapshot
|
||||
rsync -av --exclude='.git' --exclude='.gitmodules' --exclude='.github' ./ /tmp/snapshot/
|
||||
rm -rf *
|
||||
|
||||
- name: Create tar.zst snapshot
|
||||
run: |
|
||||
cd /tmp/snapshot
|
||||
tar -I 'zstd -T0 -19' -cvf "$GITHUB_WORKSPACE/Flipper-${{ steps.date.outputs.date }}.tar.zst" *
|
||||
|
||||
- name: Upload snapshot artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: snapshot
|
||||
path: Flipper-${{ steps.date.outputs.date }}.tar.zst
|
||||
|
||||
- name: Check if archive > 2GB and split if needed
|
||||
id: check_size
|
||||
run: |
|
||||
file="Flipper-${{ steps.date.outputs.date }}.tar.zst"
|
||||
max_size=$((2 * 1024 * 1024 * 1024)) # 2GB in bytes
|
||||
actual_size=$(stat -c%s "$file")
|
||||
if [ "$actual_size" -ge "$max_size" ]; then
|
||||
split -b 1996M "$file" "${file}."
|
||||
echo "split=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "split=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: "Snapshot ${{ steps.date.outputs.date }}"
|
||||
tag_name: "Snapshot-${{ steps.date.outputs.date }}"
|
||||
body: |
|
||||
Automated snapshot for ${{ steps.date.outputs.date }}.
|
||||
Note: If archive was split due to size >2GB use cat to join them together
|
||||
```
|
||||
cat Flipper-${{ steps.date.outputs.date }}.tar.zst.* > Flipper-${{ steps.date.outputs.date }}.tar.zst
|
||||
```
|
||||
files: |
|
||||
${{ steps.check_size.outputs.split == 'true' && format('Flipper-{0}.tar.zst.*', steps.date.outputs.date) || format('Flipper-{0}.tar.zst', steps.date.outputs.date) }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
@ -1 +1 @@
|
||||
Subproject commit 282ed4fae1112b643c2b34739477f1c5f9e93303
|
||||
Subproject commit 265ccb9a1111f6b67e55348fdd223d1ff9ce0ecf
|
Loading…
x
Reference in New Issue
Block a user