Skip to content

CI: update actions/download-artifact to 4 #319

CI: update actions/download-artifact to 4

CI: update actions/download-artifact to 4 #319

Workflow file for this run

# 作者:康林<[email protected]>
name: build
env:
artifact_path: artifact_path
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TransformCoordinate_VERSION: "v1.1.2"
on:
push:
pull_request:
jobs:
ubuntu:
uses: ./.github/workflows/ubuntu.yml
msvc:
uses: ./.github/workflows/msvc.yml
mingw:
uses: ./.github/workflows/mingw.yml
macos:
uses: ./.github/workflows/macos.yml
android:
uses: ./.github/workflows/android.yml
secrets: inherit
doxygen:
uses: ./.github/workflows/doxygen.yml
if: false
secrets: inherit
deploy:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
needs: [ubuntu, msvc, macos, android]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: false
# - name: Download all artifact
# uses: actions/download-artifact@v4
# with:
# path: ${{ env.artifact_path }}
- name: Download ubuntu
uses: actions/download-artifact@v4
with:
name: ${{ needs.ubuntu.outputs.name }}
path: ${{ env.artifact_path }}
- name: Download msvc
uses: actions/download-artifact@v4
with:
name: ${{ needs.msvc.outputs.name }}
path: ${{ env.artifact_path }}
- name: Download mingw
uses: actions/download-artifact@v4
with:
name: ${{ needs.mingw.outputs.name }}
path: ${{ env.artifact_path }}
- name: Download macos
uses: actions/download-artifact@v4
with:
name: ${{ needs.macos.outputs.name }}
path: ${{ env.artifact_path }}
- name: Download android
uses: actions/download-artifact@v4
with:
name: ${{ needs.android.outputs.name }}
path: ${{ env.artifact_path }}
- name: Download doxygen
uses: actions/download-artifact@v4
with:
name: ${{ needs.doxygen.outputs.name }}
path: ${{ env.artifact_path }}
- name: Process configure file
run: |
git clone https://github.com/KangLin/RabbitCommon.git
./RabbitCommon/Install/MergeJsonFile.sh \
"${{ github.workspace }}/update.json" \
"${{ env.artifact_path }}" "${{ env.artifact_path }}/version.json"
rm ${{ env.artifact_path }}/*.json
- name: Make Note.md file
run: |
echo "[:cn: 修改日志](https://github.com/KangLin/TransformCoordinate/blob/${{env.TransformCoordinate_VERSION}}/ChangeLog_zh_CN.md) [:us: Change log](https://github.com/KangLin/TransformCoordinate/blob/${{env.TransformCoordinate_VERSION}}/ChangeLog.md)" > ${{github.workspace}}/Note.md
echo "" >> ${{github.workspace}}/Note.md
echo "文件签名:" >> ${{github.workspace}}/Note.md
cd ${{ env.artifact_path }}
for file in *
do
echo "$file"
if [ -f $file ]; then
if [ "${file##*.}" != "xml" ] && [ "${file##*.}" != "json" ]; then
md5sum $file > $file.md5sum
cat $file.md5sum >> ${{github.workspace}}/Note.md
fi
else
rm -fr $file
fi
done
- name: Upload To Github Release
#if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-file ${{github.workspace}}/Note.md
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Note.md