This repository has been archived by the owner on Dec 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix action can't run on centos6 (#874) * fix package * fix uploading asset * package for centos 6 * format the code * remove redudant vars in action Co-authored-by: Yee <[email protected]> (cherry picked from commit 5c14e0f) * cherrypick 847 * update * udpate Co-authored-by: jie.wang <[email protected]>
- Loading branch information
Showing
5 changed files
with
118 additions
and
15 deletions.
There are no files selected for viewing
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Upload file to oss | ||
|
||
Upload file to oss | ||
|
||
## Inputs | ||
|
||
### `key-id` | ||
|
||
**Required** access key ID of oss. Default `''`. | ||
|
||
### `key-secret` | ||
|
||
**Required** access key secret of oss. Default `''`. | ||
|
||
### `endpoint` | ||
|
||
**Required** endpoint of oss. Default `''`. | ||
|
||
### `bucket` | ||
|
||
**Required** bucket of oss. Default `''`. | ||
|
||
### `asset-path` | ||
|
||
**Required** file path to be uploaded. Default `''`. | ||
|
||
### `target-path` | ||
|
||
**Required** path where the oss object is stored. Default `''`. | ||
|
||
## Example usage | ||
|
||
```yaml | ||
uses: ./.github/actions/upload-to-oss-action | ||
with: | ||
key-id: ${{ secrets.OSS_ID }} | ||
key-secret: ${{ secrets.OSS_SECRET }} | ||
endpoint: ${{ secrets.OSS_ENDPOINT }} | ||
bucket: nebula-graph | ||
asset-path: build/cpack_output | ||
target-path: package/v2-nightly/${{ steps.vars.outputs.subdir }} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: 'Upload to oss' | ||
description: 'Upload files to oss' | ||
inputs: | ||
key-id: | ||
description: 'access key ID' | ||
required: true | ||
default: '' | ||
key-secret: | ||
description: 'access key secret' | ||
required: true | ||
default: '' | ||
endpoint: | ||
description: 'endpooint' | ||
required: true | ||
default: '' | ||
bucket: | ||
description: 'bucket' | ||
required: true | ||
default: '' | ||
asset-path: | ||
description: 'file path to be uploaded' | ||
required: true | ||
default: '' | ||
target-path: | ||
description: 'file path stored on the OSS' | ||
required: true | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: | | ||
j=0 | ||
if [ -d ${{ inputs.asset-path }} ]; then | ||
for filename in `ls ${{ inputs.asset-path }}`; | ||
do | ||
folder_list[j]=${{ inputs.asset-path }}/$filename | ||
j=`expr $j + 1` | ||
done | ||
else | ||
folder_list[0]=${{ inputs.asset-path }} | ||
fi | ||
echo "Uploading to oss... " | ||
for filepath in ${folder_list[@]}; | ||
do | ||
ossutil64 -e ${{ inputs.endpoint}} \ | ||
-i ${{ inputs.key-id }} \ | ||
-k ${{ inputs.key-secret }} \ | ||
-f cp $filepath oss://${{ inputs.bucket }}/${{ inputs.target-path }}/$(basename ${filepath}) | ||
done | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,15 +40,12 @@ jobs: | |
filename=$(find pkg-build/cpack_output -type f \( -iname \*.deb -o -iname \*.rpm \)) | ||
sha256sum $filename > $filename.$SHA_EXT | ||
subdir=$(echo $tag |sed 's/^v//') | ||
echo "::set-output name=filepath::$filename" | ||
echo "::set-output name=shafilepath::$filename.$SHA_EXT" | ||
echo "::set-output name=subdir::$subdir" | ||
- uses: ./.github/actions/upload-assets-action | ||
with: | ||
asset-path: pkg-build/cpack_output | ||
tag: ${{ steps.tag.outputs.tag }} | ||
- name: upload package to oss | ||
uses: tvrcgo/[email protected] | ||
- uses: ./.github/actions/upload-to-oss-action | ||
with: | ||
key-id: ${{ secrets.OSS_ID }} | ||
key-secret: ${{ secrets.OSS_SECRET }} | ||
|
@@ -87,6 +84,7 @@ jobs: | |
service: | ||
- metad | ||
- storaged | ||
- tools | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ./.github/actions/tagname-action | ||
|