chore: organize the directory structure of install

This commit is contained in:
mzz2017 2020-02-20 15:52:28 +08:00
parent e136e7526f
commit 29022e2d1a
21 changed files with 153 additions and 153 deletions

View File

@ -1,136 +1,136 @@
name: Go
on:
push:
tags:
- v*
env:
NAME: v2raya
DESC: "A V2Ray linux GUI client, which support transparent proxy .\nhttps://github.com/mzz2017/v2raya"
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
jobs:
build:
name: Build
runs-on: ubuntu-16.04
steps:
- name: Get the version
id: tag
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Setup Ruby for use with actions
uses: actions/setup-ruby@v1.0.0
- name: Setup Node.js for use with actions
uses: actions/setup-node@v1.1.0
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y bsdtar rpm reprepro gnupg2 expect
# go get github.com/mitchellh/gox
# gem install fpm
# npm i -g yarn
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Before Deploy
run: |
if [[ $(pwd) =~ /apt$ ]]; then
echo 'Now in subdir "apt"'
cp -rf ../install/key ../install/conf ./;
else
mkdir -p apt/incoming && cp -r install/key install/conf apt/ && cd apt;
fi
gpg2 --version
gpg2 --import key/public-key.asc
cat ~/.gnupg/gpg.conf
../install/gpg2_expect --allow-secret-key-import --import ../install/private-key.asc
../install/reprepro_expect --ask-passphrase -Vb . export
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_i386_$VERSION.deb
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_amd64_$VERSION.deb
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm_$VERSION.deb
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm64_$VERSION.deb
cd ../
export bp=$(pwd)
- name: Build
run: |
export VERSION=${{ steps.tag.outputs.VERSION }}
export PATH=$PATH:$HOME/go/bin
cd service && gox -osarch="linux/386 linux/amd64 linux/arm linux/arm64" -ldflags="-X V2RayA/global.Version=${VERSION:1}" -output="../{{.Dir}}_{{.OS}}_{{.Arch}}_$VERSION"
cd ../
files="install/v2raya.service=/etc/systemd/system/v2raya.service gui/public/img/icons/android-chrome-512x512.png=/usr/share/icons/v2raya.png install/v2raya.desktop=/usr/share/applications/v2raya.desktop"
params="--verbose -f -n $NAME -v ${VERSION:1} --url https://github.com/mzz2017/v2raya --maintainer mzz2017 --after-install install/after_install.sh --after-upgrade install/after_upgrade.sh --before-remove install/before_remove.sh --after-remove install/after_remove.sh"
fpm -s dir -t deb -p installer_debian_i386_$VERSION.deb --description "$DESC" $params --architecture i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t deb -p installer_debian_amd64_$VERSION.deb --description "$DESC" $params --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t deb -p installer_debian_arm_$VERSION.deb --description "$DESC" $params --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t deb -p installer_debian_arm64_$VERSION.deb --description "$DESC" $params --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t rpm -p installer_redhat_i386_$VERSION.rpm --description "$DESC" $params --architecture=i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t rpm -p installer_redhat_amd64_$VERSION.rpm --description "$DESC" $params --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t rpm -p installer_redhat_arm_$VERSION.rpm --description "$DESC" $params --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t rpm -p installer_redhat_arm64_$VERSION.rpm --description "$DESC" $params --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t pacman -p installer_archlinux_i386_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t pacman -p installer_archlinux_amd64_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t pacman -p installer_archlinux_arm_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t pacman -p installer_archlinux_arm64_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t freebsd -p installer_freebsd_i386_$VERSION.txz $params --description "$DESC" --architecture=i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t freebsd -p installer_freebsd_amd64_$VERSION.txz $params --description "$DESC" --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t freebsd -p installer_freebsd_arm_$VERSION.txz $params --description "$DESC" --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
fpm -s dir -t freebsd -p installer_freebsd_arm64_$VERSION.txz $params --description "$DESC" --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
cd gui && yarn && yarn build && cd ../
- name: Deploy APT
uses: ad-m/github-push-action@v0.5.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: apt
force: true
directory: apt
- name: Deploy v.mzz.pub
uses: ad-m/github-push-action@v0.5.0
with:
github_token: ${{ secrets.ACROSS_TOKEN }}
repository: mzz2017/v2raya-web
branch: master
force: true
directory: web
- name: GH Release
uses: softprops/action-gh-release@v0.1.5
with:
files: |
V2RayA_linux_386_${{ steps.tag.outputs.VERSION }}
V2RayA_linux_amd64_${{ steps.tag.outputs.VERSION }}
V2RayA_linux_arm_${{ steps.tag.outputs.VERSION }}
V2RayA_linux_arm64_${{ steps.tag.outputs.VERSION }}
installer_debian_i386_${{ steps.tag.outputs.VERSION }}.deb
installer_debian_amd64_${{ steps.tag.outputs.VERSION }}.deb
installer_debian_arm_${{ steps.tag.outputs.VERSION }}.deb
installer_debian_arm64_${{ steps.tag.outputs.VERSION }}.deb
installer_freebsd_i386_${{ steps.tag.outputs.VERSION }}.txz
installer_freebsd_amd64_${{ steps.tag.outputs.VERSION }}.txz
installer_freebsd_arm_${{ steps.tag.outputs.VERSION }}.txz
installer_freebsd_arm64_${{ steps.tag.outputs.VERSION }}.txz
installer_redhat_i386_${{ steps.tag.outputs.VERSION }}.rpm
installer_redhat_amd64_${{ steps.tag.outputs.VERSION }}.rpm
installer_redhat_arm_${{ steps.tag.outputs.VERSION }}.rpm
installer_redhat_arm64_${{ steps.tag.outputs.VERSION }}.rpm
installer_archlinux_i386_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
installer_archlinux_amd64_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
installer_archlinux_arm_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
installer_archlinux_arm64_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
- name: Deploy AUR
run: bash install/aur.sh
#name: Go
#on:
# push:
# tags:
# - v*
#env:
# NAME: v2raya
# DESC: "A V2Ray linux GUI client, which support transparent proxy .\nhttps://github.com/mzz2017/v2raya"
# SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
#
#jobs:
#
# build:
# name: Build
# runs-on: ubuntu-16.04
# steps:
# - name: Get the version
# id: tag
# run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
#
# - name: Set up Go 1.13
# uses: actions/setup-go@v1
# with:
# go-version: 1.13
# id: go
#
# - name: Setup Ruby for use with actions
# uses: actions/setup-ruby@v1.0.0
#
# - name: Setup Node.js for use with actions
# uses: actions/setup-node@v1.1.0
#
# - name: Dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y bsdtar rpm reprepro gnupg2 expect
## go get github.com/mitchellh/gox
## gem install fpm
## npm i -g yarn
#
# - name: Check out code into the Go module directory
# uses: actions/checkout@v2
# - name: Before Deploy
# run: |
# if [[ $(pwd) =~ /apt$ ]]; then
# echo 'Now in subdir "apt"'
# cp -rf ../install/key ../install/conf ./;
# else
# mkdir -p apt/incoming && cp -r install/key install/conf apt/ && cd apt;
# fi
# gpg2 --version
# gpg2 --import key/public-key.asc
# cat ~/.gnupg/gpg.conf
# ../install/gpg2_expect --allow-secret-key-import --import ../install/private-key.asc
# ../install/reprepro_expect --ask-passphrase -Vb . export
# ../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_i386_$VERSION.deb
# ../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_amd64_$VERSION.deb
# ../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm_$VERSION.deb
# ../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm64_$VERSION.deb
# cd ../
# export bp=$(pwd)
# - name: Build
# run: |
# export VERSION=${{ steps.tag.outputs.VERSION }}
# export PATH=$PATH:$HOME/go/bin
# cd service && gox -osarch="linux/386 linux/amd64 linux/arm linux/arm64" -ldflags="-X V2RayA/global.Version=${VERSION:1}" -output="../{{.Dir}}_{{.OS}}_{{.Arch}}_$VERSION"
# cd ../
# files="install/v2raya.service=/etc/systemd/system/v2raya.service gui/public/img/icons/android-chrome-512x512.png=/usr/share/icons/v2raya.png install/v2raya.desktop=/usr/share/applications/v2raya.desktop"
# params="--verbose -f -n $NAME -v ${VERSION:1} --url https://github.com/mzz2017/v2raya --maintainer mzz2017 --after-install install/after_install.sh --after-upgrade install/after_upgrade.sh --before-remove install/before_remove.sh --after-remove install/after_remove.sh"
# fpm -s dir -t deb -p installer_debian_i386_$VERSION.deb --description "$DESC" $params --architecture i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t deb -p installer_debian_amd64_$VERSION.deb --description "$DESC" $params --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t deb -p installer_debian_arm_$VERSION.deb --description "$DESC" $params --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t deb -p installer_debian_arm64_$VERSION.deb --description "$DESC" $params --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t rpm -p installer_redhat_i386_$VERSION.rpm --description "$DESC" $params --architecture=i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t rpm -p installer_redhat_amd64_$VERSION.rpm --description "$DESC" $params --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t rpm -p installer_redhat_arm_$VERSION.rpm --description "$DESC" $params --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t rpm -p installer_redhat_arm64_$VERSION.rpm --description "$DESC" $params --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t pacman -p installer_archlinux_i386_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t pacman -p installer_archlinux_amd64_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t pacman -p installer_archlinux_arm_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t pacman -p installer_archlinux_arm64_$VERSION.pkg.tar.xz --description "$DESC" $params --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t freebsd -p installer_freebsd_i386_$VERSION.txz $params --description "$DESC" --architecture=i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t freebsd -p installer_freebsd_amd64_$VERSION.txz $params --description "$DESC" --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t freebsd -p installer_freebsd_arm_$VERSION.txz $params --description "$DESC" --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
# fpm -s dir -t freebsd -p installer_freebsd_arm64_$VERSION.txz $params --description "$DESC" --architecture=arm64 V2RayA_linux_arm64_$VERSION=/usr/bin/v2raya $files
# cd gui && yarn && yarn build && cd ../
#
#
#
# - name: Deploy APT
# uses: ad-m/github-push-action@v0.5.0
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: apt
# force: true
# directory: apt
#
# - name: Deploy v.mzz.pub
# uses: ad-m/github-push-action@v0.5.0
# with:
# github_token: ${{ secrets.ACROSS_TOKEN }}
# repository: mzz2017/v2raya-web
# branch: master
# force: true
# directory: web
#
# - name: GH Release
# uses: softprops/action-gh-release@v0.1.5
# with:
# files: |
# V2RayA_linux_386_${{ steps.tag.outputs.VERSION }}
# V2RayA_linux_amd64_${{ steps.tag.outputs.VERSION }}
# V2RayA_linux_arm_${{ steps.tag.outputs.VERSION }}
# V2RayA_linux_arm64_${{ steps.tag.outputs.VERSION }}
# installer_debian_i386_${{ steps.tag.outputs.VERSION }}.deb
# installer_debian_amd64_${{ steps.tag.outputs.VERSION }}.deb
# installer_debian_arm_${{ steps.tag.outputs.VERSION }}.deb
# installer_debian_arm64_${{ steps.tag.outputs.VERSION }}.deb
# installer_freebsd_i386_${{ steps.tag.outputs.VERSION }}.txz
# installer_freebsd_amd64_${{ steps.tag.outputs.VERSION }}.txz
# installer_freebsd_arm_${{ steps.tag.outputs.VERSION }}.txz
# installer_freebsd_arm64_${{ steps.tag.outputs.VERSION }}.txz
# installer_redhat_i386_${{ steps.tag.outputs.VERSION }}.rpm
# installer_redhat_amd64_${{ steps.tag.outputs.VERSION }}.rpm
# installer_redhat_arm_${{ steps.tag.outputs.VERSION }}.rpm
# installer_redhat_arm64_${{ steps.tag.outputs.VERSION }}.rpm
# installer_archlinux_i386_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
# installer_archlinux_amd64_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
# installer_archlinux_arm_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
# installer_archlinux_arm64_${{ steps.tag.outputs.VERSION }}.pkg.tar.xz
#
# - name: Deploy AUR
# run: bash install/aur.sh
#
#
#

View File

@ -33,8 +33,8 @@ install:
script:
- cd service && gox -osarch="linux/386 linux/amd64 linux/arm linux/arm64" -ldflags="-X V2RayA/global.Version=${VERSION:1}" -output="../{{.Dir}}_{{.OS}}_{{.Arch}}_$VERSION"
- cd ../
- files="install/v2raya.service=/etc/systemd/system/v2raya.service gui/public/img/icons/android-chrome-512x512.png=/usr/share/icons/v2raya.png install/v2raya.desktop=/usr/share/applications/v2raya.desktop"
- params="--verbose -f -n $NAME -v ${VERSION:1} --url https://github.com/mzz2017/v2raya --maintainer mzz2017 --after-install install/after_install.sh --after-upgrade install/after_upgrade.sh --before-remove install/before_remove.sh --after-remove install/after_remove.sh"
- files="install/universal/v2raya.service=/etc/systemd/system/v2raya.service gui/public/img/icons/android-chrome-512x512.png=/usr/share/icons/v2raya.png install/universal/v2raya.desktop=/usr/share/applications/v2raya.desktop"
- params="--verbose -f -n $NAME -v ${VERSION:1} --url https://github.com/mzz2017/v2raya --maintainer mzz2017 --after-install install/universal/after_install.sh --after-upgrade install/universal/after_upgrade.sh --before-remove install/universal/before_remove.sh --after-remove install/universal/after_remove.sh"
- fpm -s dir -t deb -p installer_debian_i386_$VERSION.deb --description "$DESC" $params --architecture i386 V2RayA_linux_386_$VERSION=/usr/bin/v2raya $files
- fpm -s dir -t deb -p installer_debian_amd64_$VERSION.deb --description "$DESC" $params --architecture=amd64 V2RayA_linux_amd64_$VERSION=/usr/bin/v2raya $files
- fpm -s dir -t deb -p installer_debian_arm_$VERSION.deb --description "$DESC" $params --architecture=arm V2RayA_linux_arm_$VERSION=/usr/bin/v2raya $files
@ -56,17 +56,17 @@ script:
before_deploy:
if [[ $(pwd) =~ /apt$ ]]; then
echo 'Now in subdir "apt"' &&
cp -rf ../install/key ../install/conf ./;
cp -rf ../install/debian/key ../install/debian/conf ./;
else
mkdir -p apt/incoming && cp -r install/key install/conf apt/ && cd apt;
mkdir -p apt/incoming && cp -r install/debian/key install/debian/conf apt/ && cd apt;
fi &&
gpg2 --import key/public-key.asc &&
../install/gpg2_expect --allow-secret-key-import --import ../install/private-key.asc &&
../install/reprepro_expect --ask-passphrase -Vb . export &&
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_i386_$VERSION.deb &&
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_amd64_$VERSION.deb &&
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm_$VERSION.deb &&
../install/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm64_$VERSION.deb &&
../install/tool/gpg2_expect --allow-secret-key-import --import ../install/debian/private-key.asc &&
../install/tool/reprepro_expect --ask-passphrase -Vb . export &&
../install/tool/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_i386_$VERSION.deb &&
../install/tool/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_amd64_$VERSION.deb &&
../install/tool/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm_$VERSION.deb &&
../install/tool/reprepro_expect --ask-passphrase -Vb . includedeb v2raya ../installer_debian_arm64_$VERSION.deb &&
cd ../ &&
export bp=$(pwd)
@ -118,6 +118,6 @@ deploy:
on:
tags: true
- provider: script
script: bash install/aur.sh
script: bash install/aur/deploy.sh
on:
tags: true

View File

@ -23,9 +23,9 @@ build() {
package() {
cd "V2RayA-$pkgver"
install -Dm644 "install/v2raya.service" "$pkgdir/usr/lib/systemd/system/v2raya.service"
install -Dm644 "install/universal/v2raya.service" "$pkgdir/usr/lib/systemd/system/v2raya.service"
install -Dm755 "service/v2raya" -t "$pkgdir/usr/bin/"
install -Dm644 "gui/public/img/icons/android-chrome-512x512.png" "$pkgdir/usr/share/icons/v2raya.png"
install -Dm755 "install/v2raya.desktop" -t "$pkgdir/usr/share/applications/"
install -Dm755 "install/universal/v2raya.desktop" -t "$pkgdir/usr/share/applications/"
}

View File

@ -1,11 +1,11 @@
#!/bin/bash
eval $(ssh-agent)
chmod 600 ./install/deploy_key
./install/ssh-add_expect ./install/deploy_key
chmod 600 ./install/aur/deploy_key
./install/tool/ssh-add_expect ./install/aur/deploy_key
ssh-keyscan -H aur.archlinux.org >>~/.ssh/known_hosts
git config user.name "$(git show -s --format='%an')"
git config user.email "$(git show -s --format='%ae')"
cp -f install/PKGBUILD install/.SRCINFO install/.INSTALL /tmp/
cp -f install/aur/PKGBUILD install/aur/.SRCINFO install/aur/.INSTALL /tmp/
cd /tmp/
git clone ssh://aur@aur.archlinux.org/v2raya.git
sudo cp -f /tmp/PKGBUILD /tmp/.SRCINFO /tmp/.INSTALL /tmp/v2raya/

View File

@ -35,7 +35,7 @@ type Subscription struct {
}
func NewUpdateStatus() SubscriptionStatus {
return SubscriptionStatus("上次更新:" + time.Now().Local().Format("2006-1-2 15:04:05"))
return SubscriptionStatus(time.Now().Local().Format("2006-1-2 15:04:05"))
}
func NewUpdateFailStatus(reason string) SubscriptionStatus {
return SubscriptionStatus(time.Now().Local().Format("2006-1-2 15:04:05") + "尝试更新失败:" + reason)