|
1 | | -name: push && tag && release |
| 1 | +name: push & tag & release |
2 | 2 | on: |
3 | 3 | workflow_dispatch: |
4 | 4 | permissions: write-all |
5 | 5 | jobs: |
6 | 6 | release: |
7 | 7 | runs-on: ubuntu-22.04 |
8 | 8 | 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 |
10 | 15 | with: |
| 16 | + github-server-url: https://gitee.com |
| 17 | + repository: ${{ vars.SOURCE_REPO }} |
11 | 18 | 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 |
18 | 27 | shell: bash |
19 | 28 | 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) |
23 | 30 | echo "version ${version} found." |
24 | 31 | # 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 |
27 | 35 | echo '-----BEGIN CONTENTS IN CURRENT DIR-----' |
28 | 36 | ls -a |
29 | 37 | echo '-----END CONTENTS IN CURRENT DIR-----' |
|
82 | 90 | fi |
83 | 91 | fi |
84 | 92 | env: |
85 | | - source_repo: ${{ secrets.SOURCE_REPO }} |
86 | 93 | github_repo: ${{ github.repository }} |
87 | 94 | github_token: ${{ secrets.GITHUB_TOKEN }} |
88 | 95 | github_workflow: ${{ github.event.workflow }} |
|
0 commit comments