mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-02 00:29:04 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2acf199755 |
@@ -12,17 +12,14 @@ jobs:
|
|||||||
Upload-S3:
|
Upload-S3:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.RELEASE_VERSION }}
|
fetch-depth: 0 # Fetch full history to access default branch
|
||||||
sparse-checkout: |
|
|
||||||
CMakeLists.txt
|
|
||||||
deploy/deploy_s3.sh
|
|
||||||
sparse-checkout-cone-mode: false
|
|
||||||
|
|
||||||
- name: Verify git tag
|
- name: Checkout tag and verify version
|
||||||
run: |
|
run: |
|
||||||
|
git checkout ${{ inputs.RELEASE_VERSION }}
|
||||||
TAG_NAME=${{ inputs.RELEASE_VERSION }}
|
TAG_NAME=${{ inputs.RELEASE_VERSION }}
|
||||||
CMAKE_TAG=$(grep 'set(AMNEZIAVPN_VERSION' CMakeLists.txt | sed -E 's/.*AMNEZIAVPN_VERSION ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/')
|
CMAKE_TAG=$(grep 'set(AMNEZIAVPN_VERSION' CMakeLists.txt | sed -E 's/.*AMNEZIAVPN_VERSION ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/')
|
||||||
if [[ "$TAG_NAME" == "$CMAKE_TAG" ]]; then
|
if [[ "$TAG_NAME" == "$CMAKE_TAG" ]]; then
|
||||||
@@ -32,6 +29,32 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Get deployment script from default branch
|
||||||
|
run: |
|
||||||
|
# Detect default branch (dev, main, or master)
|
||||||
|
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "")
|
||||||
|
if [[ -z "$DEFAULT_BRANCH" ]]; then
|
||||||
|
# Try to detect default branch (prioritize dev)
|
||||||
|
if git show-ref --verify --quiet refs/remotes/origin/dev; then
|
||||||
|
DEFAULT_BRANCH="dev"
|
||||||
|
elif git show-ref --verify --quiet refs/remotes/origin/main; then
|
||||||
|
DEFAULT_BRANCH="main"
|
||||||
|
elif git show-ref --verify --quiet refs/remotes/origin/master; then
|
||||||
|
DEFAULT_BRANCH="master"
|
||||||
|
else
|
||||||
|
echo "::error::Could not determine default branch"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "Default branch: $DEFAULT_BRANCH"
|
||||||
|
|
||||||
|
# Get the script from default branch
|
||||||
|
mkdir -p deploy
|
||||||
|
git show origin/$DEFAULT_BRANCH:deploy/deploy_s3.sh > deploy/deploy_s3.sh || \
|
||||||
|
(echo "::error::Could not fetch deploy_s3.sh from default branch ($DEFAULT_BRANCH)" && exit 1)
|
||||||
|
chmod +x deploy/deploy_s3.sh
|
||||||
|
echo "✓ Using deployment script from $DEFAULT_BRANCH branch"
|
||||||
|
|
||||||
- name: Setup Rclone
|
- name: Setup Rclone
|
||||||
uses: AnimMouse/setup-rclone@v1
|
uses: AnimMouse/setup-rclone@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ cd dist
|
|||||||
|
|
||||||
echo $VERSION >> VERSION
|
echo $VERSION >> VERSION
|
||||||
curl -s https://api.github.com/repos/amnezia-vpn/amnezia-client/releases/tags/$VERSION | jq -r .body | tr -d '\r' > CHANGELOG
|
curl -s https://api.github.com/repos/amnezia-vpn/amnezia-client/releases/tags/$VERSION | jq -r .body | tr -d '\r' > CHANGELOG
|
||||||
|
curl -s https://api.github.com/repos/amnezia-vpn/amnezia-client/releases/tags/$VERSION | jq -r .published_at > RELEASE_DATE
|
||||||
if [[ $(cat CHANGELOG) = null ]]; then
|
if [[ $(cat CHANGELOG) = null ]]; then
|
||||||
echo '::error::Release does not exists. Exiting with error...'
|
echo '::error::Release does not exists. Exiting with error...'
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user