CI: modify ci #101
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
name: build | |
env: | |
artifact_path: artifact_path | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
Calendar_VERSION: v1.0.9 | |
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 | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [ubuntu, msvc, macos, android] | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: false | |
- name: Download ubuntu | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ needs.ubuntu.outputs.name }} | |
path: ${{ env.artifact_path }} | |
- name: Download msvc | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ needs.msvc.outputs.name }} | |
path: ${{ env.artifact_path }} | |
- name: Download macos | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ needs.macos.outputs.name }} | |
path: ${{ env.artifact_path }} | |
- name: Download android | |
uses: actions/download-artifact@v3 | |
with: | |
name: ${{ needs.android.outputs.name }} | |
path: ${{ env.artifact_path }} | |
- name: Make note file | |
run: | | |
cd ${{ env.artifact_path }} | |
echo "[:cn: 修改日志](https://github.com/KangLin/Calendar/blob/${{env.Calendar_VERSION}}/ChangeLog_zh_CN.md)" > ${{github.workspace}}/Release.md | |
echo "[:en: Change log](https://github.com/KangLin/Calendar/blob/${{env.Calendar_VERSION}}/ChangeLog.md)" >> ${{github.workspace}}/Release.md | |
echo "" >> ${{github.workspace}}/Release.md | |
echo "文件签名:" >> ${{github.workspace}}/Release.md | |
for file in * | |
do | |
echo $file | |
if [ -f $file ]; then | |
md5sum $file > $file.md5sum | |
cat $file.md5sum >> ${{github.workspace}}/Release.md | |
fi | |
done | |
- name: Upload To Github Release | |
run: | | |
gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --notes-file ${{github.workspace}}/Release.md | |
gh release upload ${{ github.ref_name }} ${{github.workspace}}/${{ env.artifact_path }}/* | |
gh release upload ${{ github.ref_name }} ${{github.workspace}}/Release.md |