Skip to content

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

CI: update actions/download-artifact to 4

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

Workflow file for this run

# 作者:康林 <[email protected]>
name: build
env:
artifact_path: artifact_path
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LunarCalendar_VERSION: "v1.0.4"
on:
push:
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
secrets: inherit
#if: ${{ startsWith(github.ref, 'refs/tags/') }}
deploy:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
needs: [ubuntu, msvc, mingw, macos, android, doxygen]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Download ubuntu
uses: 6.6.3actions/download-artifact@v4
with:
name: ${{ needs.ubuntu.outputs.name }}
path: ${{ env.artifact_path }}
- name: Download msvc
uses: 6.6.3actions/download-artifact@v4
with:
pattern: ${{ needs.msvc.outputs.name }}*
path: ${{ env.artifact_path }}
- name: Download mingw
uses: 6.6.3actions/download-artifact@v4
with:
name: ${{ needs.mingw.outputs.name }}
path: ${{ env.artifact_path }}
- name: Download macos
uses: 6.6.3actions/download-artifact@v4
with:
pattern: ${{ needs.macos.outputs.name }}*
path: ${{ env.artifact_path }}
- name: Download android
uses: 6.6.3actions/download-artifact@v4
with:
pattern: ${{ needs.android.outputs.name }}*
path: ${{ env.artifact_path }}
- name: Download doxygen
uses: 6.6.3actions/download-artifact@v4
with:
name: ${{ needs.doxygen.outputs.name }}
path: ${{ env.artifact_path }}
- name: Make Notes.md file
run: |
cd ${{ env.artifact_path }}
echo "[:cn: 修改日志](https://github.com/KangLin/LunarCalendar/blob/${{env.LunarCalendar_VERSION}}/ChangeLog.md)" > ${{github.workspace}}/Notes.md
echo "" >> ${{github.workspace}}/Notes.md
echo "文件签名:" >> ${{github.workspace}}/Notes.md
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}}/Notes.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}}/Notes.md
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* ${{github.workspace}}/Notes.md