fix: shallow
This commit is contained in:
@@ -51,21 +51,6 @@ jobs:
|
|||||||
name: wgrplane-linux-${{ matrix.goarch }}
|
name: wgrplane-linux-${{ matrix.goarch }}
|
||||||
path: wgrplane-linux-${{ matrix.goarch }}
|
path: wgrplane-linux-${{ matrix.goarch }}
|
||||||
|
|
||||||
- name: Cleanup Git Config
|
|
||||||
if: always() # Pastikan tetap jalan meski job gagal
|
|
||||||
run: |
|
|
||||||
git config --global --unset-all url."https://token:${{ gitea.token }}@${{ gitea.server_url | replace("https://", "") }}/".insteadOf
|
|
||||||
|
|
||||||
generate-latest-json:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Clone repository with submodules
|
|
||||||
run: |
|
|
||||||
git config --global url."https://token:${{ gitea.token }}@${{ gitea.server_url | replace("https://", "") }}/".insteadOf "${{ gitea.server_url }}/"
|
|
||||||
git clone --recurse-submodules ${{ gitea.server_url }}/${{ gitea.repository }}.git .
|
|
||||||
ls -la app/ # Debug
|
|
||||||
|
|
||||||
- name: Generate latest.json
|
- name: Generate latest.json
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ gitea.ref_name }}"
|
VERSION="${{ gitea.ref_name }}"
|
||||||
@@ -73,7 +58,6 @@ jobs:
|
|||||||
VERSION="$(git rev-parse --short HEAD)"
|
VERSION="$(git rev-parse --short HEAD)"
|
||||||
fi
|
fi
|
||||||
RELEASE_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
RELEASE_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||||
# Get changelog: commits since last tag, or last 10 commits
|
|
||||||
CHANGELOG="$(git log --oneline --no-merges $(git describe --tags --abbrev=0 2>/dev/null || echo 'HEAD~10')..HEAD 2>/dev/null || git log --oneline --no-merges -10)"
|
CHANGELOG="$(git log --oneline --no-merges $(git describe --tags --abbrev=0 2>/dev/null || echo 'HEAD~10')..HEAD 2>/dev/null || git log --oneline --no-merges -10)"
|
||||||
# Generate latest.json
|
# Generate latest.json
|
||||||
cat > latest.json << EOF
|
cat > latest.json << EOF
|
||||||
@@ -82,25 +66,19 @@ jobs:
|
|||||||
"release_date": "$RELEASE_DATE",
|
"release_date": "$RELEASE_DATE",
|
||||||
"changelog": $(echo "$CHANGELOG" | jq -R -s '.'),
|
"changelog": $(echo "$CHANGELOG" | jq -R -s '.'),
|
||||||
"download_urls": {
|
"download_urls": {
|
||||||
"amd64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ secrets.TOKEN }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == \"wgrplane-linux-amd64\") | .id')",
|
"amd64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ secrets.TOKEN }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == "wgrplane-linux-amd64") | .id')",
|
||||||
"arm64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ secrets.TOKEN }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == \"wgrplane-linux-arm64\") | .id')"
|
"arm64": "${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts/$(curl -s -H 'Authorization: Bearer ${{ secrets.TOKEN }}' '${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}/artifacts' | jq -r '.data[] | select(.name == "wgrplane-linux-arm64") | .id')"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Checkout main branch
|
|
||||||
run: |
|
|
||||||
git fetch origin main
|
|
||||||
git checkout main
|
|
||||||
|
|
||||||
- name: Commit and push latest.json
|
|
||||||
run: |
|
|
||||||
git add latest.json
|
|
||||||
git commit -m "Update latest.json for release ${{ gitea.ref_name }} [skip ci]" || echo "No changes to commit"
|
|
||||||
git push origin main
|
|
||||||
|
|
||||||
- name: Upload latest.json artifact
|
- name: Upload latest.json artifact
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
||||||
with:
|
with:
|
||||||
name: latest.json
|
name: latest.json
|
||||||
path: latest.json
|
path: latest.json
|
||||||
|
|
||||||
|
- name: Cleanup Git Config
|
||||||
|
if: always() # Pastikan tetap jalan meski job gagal
|
||||||
|
run: |
|
||||||
|
git config --global --unset-all url."https://token:${{ gitea.token }}@${{ gitea.server_url | replace("https://", "") }}/".insteadOf
|
||||||
|
|||||||
Reference in New Issue
Block a user