Skip to content

Commit

Permalink
fix oss upload
Browse files Browse the repository at this point in the history
  • Loading branch information
valord577 committed May 14, 2024
1 parent 207881c commit bd9a969
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/_buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ on:

env:
_OSSUTIL_VER: 'v1.7.18'
GH_OSSUTIL_AK: ${{ secrets.GH_OSSUTIL_AK }}
GH_OSSUTIL_SK: ${{ secrets.GH_OSSUTIL_SK }}
GH_OSSUTIL_BUCKET: ${{ secrets.GH_OSSUTIL_BUCKET }}
GH_OSSUTIL_ENDPOINT: ${{ secrets.GH_OSSUTIL_ENDPOINT }}
GH_OSSUTIL_PKGS: ${{ secrets.GH_OSSUTIL_PKGS }}
GH_OSSUTIL_CONF_PATH: ${{ github.workspace }}/ossutilconfig
GH_OSSUTIL_CNAME: ${{ secrets.GH_OSSUTIL_CNAME }}

jobs:
_buildx:
Expand Down Expand Up @@ -65,8 +68,6 @@ jobs:
curl -fsSL -X GET -o "ossutil.zip" \
--url "https://github.com/aliyun/ossutil/releases/download/${{ env._OSSUTIL_VER }}/ossutil-${{ env._OSSUTIL_VER }}-mac-${ARCH}.zip"
unzip -j ossutil.zip "*/ossutil" -d .; echo "${PWD}" >> "$GITHUB_PATH"
echo -e '${{ secrets.GH_OSSUTIL_CONF }}' > ${GH_OSSUTIL_CONF_PATH}
- name: gh action ccache restore
uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -137,8 +138,6 @@ jobs:
curl -fsSL -X GET -o "ossutil.zip" \
--url "https://github.com/aliyun/ossutil/releases/download/${{ env._OSSUTIL_VER }}/ossutil-${{ env._OSSUTIL_VER }}-linux-${ARCH}.zip"
unzip -j ossutil.zip "*/ossutil" -d .; echo "${PWD}" >> "$GITHUB_PATH"
echo -e '${{ secrets.GH_OSSUTIL_CONF }}' > ${GH_OSSUTIL_CONF_PATH}
- name: show debug info
run: |
env
Expand All @@ -156,4 +155,5 @@ jobs:
ossutil cp \
${{ github.workflow }}/${{ needs._buildx.outputs.version }} \
oss://${GH_OSSUTIL_BUCKET}/${GH_OSSUTIL_PKGS}/${{ github.workflow }}/${{ needs._buildx.outputs.version }} \
--include "*.zip" -r --only-current-dir --disable-dir-object -c ${GH_OSSUTIL_CONF_PATH}
--include "*.zip" -r --only-current-dir --disable-dir-object \
-e ${GH_OSSUTIL_ENDPOINT} -i ${GH_OSSUTIL_AK} -k ${GH_OSSUTIL_SK}
3 changes: 2 additions & 1 deletion pkg-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function dl_pkgc() {
dl_url=$(
ossutil sign \
oss://${GH_OSSUTIL_BUCKET}/${GH_OSSUTIL_PKGS}/${pkg_name}/${pkg_version}/${dl_filename} \
--disable-encode-slash -c ${GH_OSSUTIL_CONF_PATH} | grep "${dl_filename}"
--disable-encode-slash -e ${GH_OSSUTIL_ENDPOINT} -i ${GH_OSSUTIL_AK} -k ${GH_OSSUTIL_SK} \
| grep "${dl_filename}" | sed "s@://${GH_OSSUTIL_BUCKET}.${GH_OSSUTIL_ENDPOINT}/@://${GH_OSSUTIL_CNAME}/@g"
)
curl --silent --fail --url "${dl_url}" -L -X GET -o "${pkg_name}.zip"
unzip -q "${pkg_name}.zip"
Expand Down

0 comments on commit bd9a969

Please sign in to comment.