Skip to content

Commit f3ef9b1

Browse files
authored
Update push-tag-release.yml
1 parent d0eeec1 commit f3ef9b1

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/push-tag-release.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
1-
name: push && tag && release
1+
name: push & tag & release
22
on:
33
workflow_dispatch:
44
permissions: write-all
55
jobs:
66
release:
77
runs-on: ubuntu-22.04
88
steps:
9-
- uses: actions/checkout@v3
9+
- name: Configure
10+
run: |
11+
git config --global user.name ${{ vars.SDK_USERNAME }}
12+
git config --global user.email ${{ vars.SDK_EMAIL }}
13+
- name: Pull source
14+
uses: actions/checkout@v3
1015
with:
16+
github-server-url: https://gitee.com
17+
repository: ${{ vars.SOURCE_REPO }}
1118
ssh-key: ${{ secrets.SSH_KEY }}
12-
fetch-depth: 0
13-
- name: config
14-
run: |
15-
git config user.name ${{ vars.SDK_USERNAME }}
16-
git config user.email ${{ vars.SDK_EMAIL }}
17-
- name: push && tag && release
19+
ssh-known-hosts: ${{ secrets.KNOWN_HOSTS }}
20+
path: source
21+
- name: Pull target
22+
uses: actions/checkout@v3
23+
with:
24+
ssh-key: ${{ secrets.SSH_KEY }}
25+
path: target
26+
- name: Push & Tag & Release
1827
shell: bash
1928
run: |
20-
# Pull the code from the source repository
21-
git clone --branch=master-dev --depth=1 $source_repo ../source_repo
22-
version=$(cat ../source_repo/VERSION)
29+
version=$(cat source/VERSION)
2330
echo "version ${version} found."
2431
# Organize the content
25-
find . -maxdepth 1 -mindepth 1 | grep -Ev '*git*' | xargs -I '{}' rm -rf '{}'
26-
find ../source_repo -maxdepth 1 -mindepth 1 | grep -Ev '*git*|.cid|.codecheck|buildscript' | xargs -I '{}' cp -a '{}' .
32+
find target/ -maxdepth 1 -mindepth 1 | grep -Ev '*git*' | xargs -I '{}' rm -rf '{}'
33+
find source/ -maxdepth 1 -mindepth 1 | grep -Ev '*git*|.cid|.codecheck|buildscript' | xargs -I '{}' cp -a '{}' target/
34+
cd target || exit 1
2735
echo '-----BEGIN CONTENTS IN CURRENT DIR-----'
2836
ls -a
2937
echo '-----END CONTENTS IN CURRENT DIR-----'
@@ -82,7 +90,6 @@ jobs:
8290
fi
8391
fi
8492
env:
85-
source_repo: ${{ secrets.SOURCE_REPO }}
8693
github_repo: ${{ github.repository }}
8794
github_token: ${{ secrets.GITHUB_TOKEN }}
8895
github_workflow: ${{ github.event.workflow }}

0 commit comments

Comments
 (0)