Release X-ui #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release X-ui | |
on: | |
push: | |
tags: | |
- 0.* | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: true | |
prerelease: true | |
freebsdamd64build: | |
name: build x-ui amd64 version | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18 | |
- name: build freedbsd amd64 version | |
run: | | |
CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o xui-release -v main.go | |
mkdir x-ui | |
cp xui-release x-ui/xui-release | |
cp x-ui.service x-ui/x-ui.service | |
cp x-ui.sh x-ui/x-ui.sh | |
cd x-ui | |
mv xui-release x-ui | |
mkdir bin | |
cd bin | |
wget https://github.com/XTLS/Xray-core/releases/latest/download/Xray-freebsd-64.zip | |
unzip Xray-freebsd-64.zip | |
rm -f Xray-freebsd-64.zip geoip.dat geosite.dat | |
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat | |
wget https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat | |
mv xray xray-freebsd-amd64 | |
cd .. | |
cd .. | |
- name: package | |
run: tar -zcvf x-ui-freebsd-amd64.tar.gz x-ui | |
- name: upload | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload_url }} | |
asset_path: x-ui-freebsd-amd64.tar.gz | |
asset_name: x-ui-freebsd-amd64.tar.gz | |
asset_content_type: application/gzip |