Skip to content

Commit

Permalink
ci: 修复ci发版错误 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO authored Sep 6, 2023
1 parent 195c3a4 commit 1625997
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,33 +245,11 @@ jobs:
name: MAA-macos-${{ matrix.arch }}
path: "install"

release:
if: ${{ needs.meta.outputs.is_release == 'true' }}
needs: [meta, windows, ubuntu, macos]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
with:
path: assets

- run: |
cd assets
for f in */; do
(cd $f && zip -r ../$f-${{ needs.meta.outputs.tag }}.zip .)
done
- uses: softprops/action-gh-release@v1
with:
files: assets/*.zip
tag_name: ${{ needs.meta.outputs.tag }}

nuget_pack:
needs: [meta, windows, ubuntu, macos]
runs-on: ubuntu-latest
env:
NUGET_PACKAGE_ID: Maa.Framework.Runtimes # need ${{ secrets.NuGetAPIKey }}
NUGET_PACKAGE_SOURCE: https://api.nuget.org/v3/index.json # https://apiint.nugettest.org/v3/index.json

steps:
- uses: nuget/setup-nuget@v1
Expand All @@ -292,14 +270,36 @@ jobs:
- uses: actions/upload-artifact@v3
if: always()
with:
name: nupkgs
name: MAA-nupkgs
path: "pkgs/nupkgs/*.nupkg"


release:
if: ${{ needs.meta.outputs.is_release == 'true' }}
needs: [meta, windows, ubuntu, macos, nuget_pack]
runs-on: ubuntu-latest
env:
NUGET_PACKAGE_SOURCE: https://api.nuget.org/v3/index.json # https://apiint.nugettest.org/v3/index.json

steps:
- uses: actions/download-artifact@v3
with:
path: assets

- run: |
cd assets
for f in *; do
(cd $f && zip -r ../$f-${{ needs.meta.outputs.tag }}.zip .)
done
- uses: softprops/action-gh-release@v1
with:
files: assets/*.zip
tag_name: ${{ needs.meta.outputs.tag }}

- name: Publish Nupkgs
if: ${{ needs.meta.outputs.is_release == 'true' }}
working-directory: pkgs/nupkgs
run: |
nuget push *.nupkg \
nuget push assets/MAA-nupkgs/*.nupkg \
-ApiKey ${{ secrets.NuGetAPIKey }} \
-Source $NUGET_PACKAGE_SOURCE \
-SkipDuplicate

0 comments on commit 1625997

Please sign in to comment.