2024-05-13 21:55:06 +01:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
2024-05-13 22:58:52 +01:00
|
|
|
workflow_dispatch:
|
2024-05-13 21:55:06 +01:00
|
|
|
|
2024-05-13 22:47:17 +01:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2024-05-13 21:55:06 +01:00
|
|
|
jobs:
|
|
|
|
update:
|
|
|
|
name: Update
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Update
|
|
|
|
run: |
|
|
|
|
#!/bin/bash
|
|
|
|
latestVersion="$(curl -q --fail 'https://api.github.com/repos/dani-garcia/vaultwarden/releases/latest' | jq -r '.tag_name' -)"
|
2024-07-16 09:36:24 +01:00
|
|
|
if gh release view "$latestVersion" --repo "$GITHUB_REPOSITORY"; then
|
2024-05-13 22:58:52 +01:00
|
|
|
echo "VaultWarden Binary: Version already exists"
|
2024-05-13 21:55:06 +01:00
|
|
|
exit 0
|
|
|
|
fi
|
2024-05-13 22:58:52 +01:00
|
|
|
|
|
|
|
archArr=(linux/amd64 linux/arm64 linux/arm/v7 linux/arm/v6)
|
|
|
|
for arch in ${archArr[@]}; do
|
|
|
|
arch2="${arch//\//-}"
|
|
|
|
mkdir "$arch2"
|
|
|
|
docker pull --platform "$arch" vaultwarden/server:"$latestVersion"
|
|
|
|
id="$(docker create vaultwarden/server:"$latestVersion")"
|
|
|
|
docker cp "$id":/vaultwarden "$arch2/vaultwarden"
|
|
|
|
docker cp "$id":/web-vault "$arch2/web-vault"
|
|
|
|
docker rm -v "$id"
|
|
|
|
tar -cvf vaultwarden-"$arch2".tar.gz "$arch2/vaultwarden" "$arch2/web-vault"
|
|
|
|
done
|
2025-01-27 23:10:12 +00:00
|
|
|
gh release create "$latestVersion" --title "$latestVersion" --repo "$GITHUB_REPOSITORY" --notes "Update to [$latestVersion](https://github.com/dani-garcia/vaultwarden/releases/tag/$latestVersion)" *.tar.gz
|
2024-05-13 22:44:30 +01:00
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ github.token }}
|