mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
93 lines
3.0 KiB
YAML
93 lines
3.0 KiB
YAML
name: "Upload debs"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "palera1n tag"
|
|
required: true
|
|
type: string
|
|
|
|
release:
|
|
types: [published]
|
|
|
|
env:
|
|
TAG: ${{ github.event.inputs.version || github.event.release.tag_name }}
|
|
|
|
jobs:
|
|
upload:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download debs from tag
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release download "${{ env.TAG }}"
|
|
|
|
if [ ! -f "palera1n-iphoneos-arm64.deb" ] || [ ! -f "palera1n-iphoneos-arm.deb" ]; then
|
|
echo "Debs not found :/"
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p cdn-upload
|
|
cp *.tar.gz cdn-upload/
|
|
cp *.deb cdn-upload/
|
|
cp *.dmg cdn-upload/
|
|
|
|
- name: Upload debs to repo
|
|
if: github.repository == 'palera1n/palera1n'
|
|
env:
|
|
USERNAME: GitHub-Actions
|
|
API_TOKEN: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
|
GH_REPO: palera1n/repo.palera.in
|
|
run: |
|
|
git clone https://$USERNAME:[email protected]/$GH_REPO.git repo-upload
|
|
|
|
ARM64_HASH=$(sha256sum palera1n-iphoneos-arm64.deb | cut -c1-8)
|
|
ARM_HASH=$(sha256sum palera1n-iphoneos-arm.deb | cut -c1-8)
|
|
cp palera1n-iphoneos-arm64.deb repo-upload/pool/iphoneos-arm64/palera1n_${{ env.TAG }}_${ARM64_HASH}_iphoneos-arm64.deb
|
|
cp palera1n-iphoneos-arm.deb repo-upload/pool/iphoneos-arm/palera1n_${{ env.TAG }}_${ARM_HASH}_iphoneos-arm.deb
|
|
|
|
cd repo-upload
|
|
|
|
git config user.name "$USERNAME"
|
|
git config user.email "[email protected]"
|
|
|
|
git add .
|
|
git commit -m "Update palera1n for ${{ env.TAG }}" || exit 0
|
|
git push https://$USERNAME:[email protected]/$GH_REPO.git
|
|
|
|
- name: Upload artifacts to cdn
|
|
if: github.repository == 'palera1n/palera1n'
|
|
uses: wangyucode/sftp-upload-action@v3
|
|
with:
|
|
host: ${{ secrets.NICKCHAN_FTP_HOST }}
|
|
port: ${{ secrets.NICKCHAN_FTP_PORT }}
|
|
username: palera1n
|
|
password: ${{ secrets.NICKCHAN_FTP_PASS }}
|
|
forceUpload: true
|
|
dryRun: false
|
|
localDir: 'cdn-upload'
|
|
remoteDir: "/palera1n/c-rewrite/releases/${{ env.TAG }}"
|
|
|
|
- name: Bump palen1x
|
|
if: github.repository == 'palera1n/palera1n'
|
|
env:
|
|
USERNAME: GitHub-Actions
|
|
API_TOKEN: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
|
GH_REPO: palera1n/palen1x
|
|
run: |
|
|
git clone https://$USERNAME:[email protected]/$GH_REPO.git tag
|
|
cd tag
|
|
|
|
git config --global user.name "$USERNAME"
|
|
git config --global user.email "[email protected]"
|
|
|
|
git commit --allow-empty -m "bump to ${{ env.TAG }}"
|
|
git push https://$USERNAME:[email protected]/$GH_REPO.git Alpine
|
|
|
|
git tag "${{ env.TAG }}"
|
|
git push https://$USERNAME:[email protected]/$GH_REPO.git "${{ env.TAG }}"
|