X-UI Go Mod Upgrade #284
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
# This is a basic workflow to help you get started with Actions | |
name: X-UI Go Mod Upgrade | |
# Allows you to run this workflow manually from the Actions tab | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: GoLang 1.x.y | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '^1.19.3' # The Go version to download (if necessary) and use. | |
- name: Start Setup | |
run: | | |
sudo apt-get update | |
sudo apt-get install -yq git sshpass python-is-python3 | |
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > $HOME/repo | |
sudo mv $HOME/repo /usr/bin/ | |
sudo chmod +x /usr/bin/repo | |
- name: Setup git Store Password | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global credential.helper store | |
export FULL_TOKEN=${{ secrets.TOKEN_ONE }}${{ secrets.TOKEN_TWO }}${{ secrets.TOKEN_THREE }} | |
sshpass -p ${FULL_TOKEN} git clone https://dopaemon@github.com/X-UI-Unofficial/Store-Passwd.git | |
- name: Start repo Source | |
run: | | |
mkdir -p $HOME/X-UI | |
cd $HOME/X-UI | |
repo init -u https://github.com/X-UI-Unofficial/manifest.git -b main | |
repo sync -j$(nproc --all) | |
- name: Start Update Modules X-UI | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd $HOME/X-UI/x-ui | |
go mod tidy | |
go get -u | |
go mod download | |
- name: Start push GoLang module | |
run: | | |
cd $HOME/X-UI/x-ui | |
git config --local user.name "dopaemon" | |
git config --local user.email "polarisdp@gmail.com" | |
git remote add origin "https://github.com/X-UI-Unofficial/x-ui.git" | |
git checkout -b main | |
git add -v go.mod | |
git add -v go.sum | |
git commit -s -m "GoLang: Upgrade go mod $(date +%Y%m%d%H%M)" | |
git push -f -u origin main |