mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update main.yml
This commit is contained in:
parent
b78aebfc06
commit
a535bcc60c
1 changed files with 39 additions and 12 deletions
51
.github/workflows/main.yml
vendored
51
.github/workflows/main.yml
vendored
|
@ -25,13 +25,12 @@ jobs:
|
||||||
- name: Clone source code
|
- name: Clone source code
|
||||||
env:
|
env:
|
||||||
REPO_URL: https://github.com/ysurac/openmptcprouter
|
REPO_URL: https://github.com/ysurac/openmptcprouter
|
||||||
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
|
||||||
run: |
|
run: |
|
||||||
git clone --depth 1 $REPO_URL openmptcprouter
|
git clone --depth 1 $REPO_URL openmptcprouter
|
||||||
cd openmptcprouter
|
cd openmptcprouter
|
||||||
if [ "$SOURCE_BRANCH" != "Test-Github-Actions" ]; then
|
if [ "$SOURCE_NAME" != "Test-Github-Actions" ] && [ "$SOURCE_NAME" != "develop" ]; then
|
||||||
git checkout ${SOURCE_BRANCH:-$SOURCE_TAG}
|
git checkout master
|
||||||
else
|
else
|
||||||
git checkout develop
|
git checkout develop
|
||||||
fi
|
fi
|
||||||
|
@ -40,10 +39,9 @@ jobs:
|
||||||
working-directory: ./openmptcprouter
|
working-directory: ./openmptcprouter
|
||||||
env:
|
env:
|
||||||
OMR_FEED_URL: https://github.com/ysurac/openmptcprouter-feeds
|
OMR_FEED_URL: https://github.com/ysurac/openmptcprouter-feeds
|
||||||
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
|
||||||
run: |
|
run: |
|
||||||
OMR_FEED_SRC="${SOURCE_BRANCH:-$SOURCE_TAG}" sh build.sh prepare {tools,toolchain}/install -j$(nproc)
|
OMR_FEED_SRC="${SOURCE_NAME}" sh build.sh prepare {tools,toolchain}/install -j$(nproc)
|
||||||
#echo -e "${{ secrets.OMR_PRIVKEY }}" > $OMR_TARGET/source/key-build
|
#echo -e "${{ secrets.OMR_PRIVKEY }}" > $OMR_TARGET/source/key-build
|
||||||
#echo -e "${{ secrets.OMR_PUBKEY }}" > $OMR_TARGET/source/key-build.pub
|
#echo -e "${{ secrets.OMR_PUBKEY }}" > $OMR_TARGET/source/key-build.pub
|
||||||
- name: Build packages
|
- name: Build packages
|
||||||
|
@ -54,7 +52,8 @@ jobs:
|
||||||
working-directory: ./openmptcprouter
|
working-directory: ./openmptcprouter
|
||||||
run: |
|
run: |
|
||||||
make IGNORE_ERRORS=m -C $OMR_TARGET/source target/install -j$(nproc)
|
make IGNORE_ERRORS=m -C $OMR_TARGET/source target/install -j$(nproc)
|
||||||
- name: Deploy - Create directory
|
- if: steps.branch_name.outputs.SOURCE_BRANCH == ''
|
||||||
|
name: Deploy - Create directory
|
||||||
uses: fifsky/ssh-action@master
|
uses: fifsky/ssh-action@master
|
||||||
env:
|
env:
|
||||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||||
|
@ -62,16 +61,31 @@ jobs:
|
||||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||||
with:
|
with:
|
||||||
command: |
|
command: |
|
||||||
mkdir -p deploy/${{env.SOURCE_BRANCH:-release}}/${{env.SOURCE_TAG:-$OMR_KERNEL}}/${{env.OMR_TARGET}}
|
mkdir -p deploy/release/${{env.SOURCE_TAG}}/${{env.OMR_TARGET}}
|
||||||
host: ${{ secrets.OMR_DEPLOY_HOST }}
|
host: ${{ secrets.OMR_DEPLOY_HOST }}
|
||||||
user: deploy
|
user: deploy
|
||||||
port: ${{ secrets.OMR_DEPLOY_PORT }}
|
port: ${{ secrets.OMR_DEPLOY_PORT }}
|
||||||
key: ${{ secrets.PRIVATE_KEY }}
|
key: ${{ secrets.PRIVATE_KEY }}
|
||||||
- name: Deploy - Upload via rsync
|
- if: steps.branch_name.outputs.SOURCE_BRANCH != ''
|
||||||
|
name: Deploy - Create directory
|
||||||
|
uses: fifsky/ssh-action@master
|
||||||
|
env:
|
||||||
|
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||||
|
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
||||||
|
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||||
|
with:
|
||||||
|
command: |
|
||||||
|
mkdir -p deploy/${{env.SOURCE_BRANCH}}/${{env.OMR_KERNEL}}/${{env.OMR_TARGET}}
|
||||||
|
host: ${{ secrets.OMR_DEPLOY_HOST }}
|
||||||
|
user: deploy
|
||||||
|
port: ${{ secrets.OMR_DEPLOY_PORT }}
|
||||||
|
key: ${{ secrets.PRIVATE_KEY }}
|
||||||
|
- if: steps.branch_name.outputs.SOURCE_BRANCH == ''
|
||||||
|
name: Deploy - Upload via rsync
|
||||||
uses: frankfoerster/github-actions-rsync@master
|
uses: frankfoerster/github-actions-rsync@master
|
||||||
with:
|
with:
|
||||||
RSYNC_OPTIONS: -av --delete-after
|
RSYNC_OPTIONS: -av --delete-after
|
||||||
RSYNC_TARGET: deploy/${{env.SOURCE_BRANCH:-release}}/${{env.SOURCE_TAG:-$env.OMR_KERNEL}}/${{env.OMR_TARGET}}
|
RSYNC_TARGET: deploy/release/${{env.SOURCE_TAG}}/${{env.OMR_TARGET}}
|
||||||
RSYNC_SOURCE: ./openmptcprouter/${{env.OMR_TARGET}}/source/bin/
|
RSYNC_SOURCE: ./openmptcprouter/${{env.OMR_TARGET}}/source/bin/
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
|
||||||
|
@ -80,4 +94,17 @@ jobs:
|
||||||
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||||
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
||||||
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||||
|
- if: steps.branch_name.outputs.SOURCE_BRANCH != ''
|
||||||
|
name: Deploy - Upload via rsync
|
||||||
|
uses: frankfoerster/github-actions-rsync@master
|
||||||
|
with:
|
||||||
|
RSYNC_OPTIONS: -av --delete-after
|
||||||
|
RSYNC_TARGET: deploy/${{env.SOURCE_BRANCH}}/${{env.OMR_KERNEL}}/${{env.OMR_TARGET}}
|
||||||
|
RSYNC_SOURCE: ./openmptcprouter/${{env.OMR_TARGET}}/source/bin/
|
||||||
|
env:
|
||||||
|
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
|
||||||
|
SSH_USERNAME: deploy
|
||||||
|
SSH_HOSTNAME: ${{ secrets.OMR_DEPLOY_HOST }}
|
||||||
|
SOURCE_NAME: ${{ steps.branch_name.outputs.SOURCE_NAME }}
|
||||||
|
SOURCE_BRANCH: ${{ steps.branch_name.outputs.SOURCE_BRANCH }}
|
||||||
|
SOURCE_TAG: ${{ steps.branch_name.outputs.SOURCE_TAG }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue