mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-05-24 02:48:02 +08:00
actions: fix pacman build
This commit is contained in:
parent
c2301f66a4
commit
efc7abc6e0
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
@ -196,30 +196,21 @@ jobs:
|
||||
curl https://github.com/golang/go/commit/9e43850a3298a9b8b1162ba0033d4c53f8637571.diff | patch --verbose -R -p 1
|
||||
|
||||
- name: Set variables
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' }}
|
||||
run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Set variables
|
||||
if: ${{ github.event_name == 'pull_request' || (github.event_name != 'workflow_dispatch' && github.ref_name == 'Alpha') }}
|
||||
run: echo "VERSION=alpha-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Set Time Variable
|
||||
run: |
|
||||
VERSION="${GITHUB_REF_NAME,,}-$(git rev-parse --short HEAD)"
|
||||
PackageVersion="$(curl -s "https://api.github.com/repos/MetaCubeX/mihomo/releases/latest" | jq -r '.tag_name' | sed 's/v//g' | awk -F '.' '{$NF = $NF + 1; print}' OFS='.').${VERSION/-/.}"
|
||||
if [ -n "${{ github.event.inputs.version }}" ]; then
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
PackageVersion="${VERSION#v}" >> $GITHUB_ENV
|
||||
fi
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
echo "PackageVersion=${PackageVersion}" >> $GITHUB_ENV
|
||||
|
||||
echo "BUILDTIME=$(date)" >> $GITHUB_ENV
|
||||
echo "CGO_ENABLED=0" >> $GITHUB_ENV
|
||||
echo "BUILDTAG=-extldflags --static" >> $GITHUB_ENV
|
||||
echo "GOTOOLCHAIN=local" >> $GITHUB_ENV
|
||||
|
||||
- name: Set PackageVersion
|
||||
run: |
|
||||
PackageVersion=$(curl -s "https://api.github.com/repos/MetaCubeX/mihomo/releases/latest" | grep -o '"tag_name": "[^"]*' | grep -o '[^"]*$' | sed 's/v//g' )
|
||||
if [ $(git branch | awk -F ' ' '{print $2}') = "Alpha" ]; then
|
||||
PackageVersion="$(echo "${PackageVersion}" | awk -F '.' '{$NF = $NF + 1; print}' OFS='.').${VERSION/-/.}"
|
||||
fi
|
||||
echo "PackageVersion=${PackageVersion}" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup NDK
|
||||
if: ${{ matrix.jobs.goos == 'android' }}
|
||||
uses: nttld/setup-ndk@v1
|
||||
@ -243,7 +234,7 @@ jobs:
|
||||
|
||||
- name: Update CA
|
||||
run: |
|
||||
sudo apt-get install ca-certificates
|
||||
sudo apt-get update && sudo apt-get install ca-certificates
|
||||
sudo update-ca-certificates
|
||||
cp -f /etc/ssl/certs/ca-certificates.crt component/ca/ca-certificates.crt
|
||||
|
||||
@ -298,7 +289,7 @@ jobs:
|
||||
run: |
|
||||
set -xeuo pipefail
|
||||
sudo gem install fpm
|
||||
sudo apt-get install -y libarchive-tools
|
||||
sudo apt-get update && sudo apt-get install -y libarchive-tools
|
||||
cp .github/release/.fpm_systemd .fpm
|
||||
|
||||
fpm -t pacman \
|
||||
|
Loading…
Reference in New Issue
Block a user