Skip to content

Commit

Permalink
test action
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Apr 2, 2024
1 parent 732d029 commit 9f37b87
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 29 deletions.
83 changes: 55 additions & 28 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,25 @@ jobs:
run: pnpm run ${{ matrix.config.electron_args }}
working-directory: ${{ github.workspace }}/go/src/github.com/Hi-Windom/Sillot/app

- name: Upload Release
uses: actions/upload-release-asset@v1
- name: Upload Release Asset via REST API
run: |
asset_name="Sillot-${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}"
asset_path="${{ github.workspace }}/go/src/github.com/Hi-Windom/Sillot/app/build/Sillot-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}"
upload_url="{{ needs.create_release.outputs.upload_url }}"
# Calculate the asset size
asset_size=$(stat -c%s "$asset_path")
# Generate the POST URL with asset name
post_url="$upload_url?name=$asset_name"
# Send the POST request with asset data
curl \
-X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$asset_path" \
-H "Content-Length: $asset_size" \
"$post_url"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 这里使用 bot
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: Sillot-${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}
asset_path: ${{ github.workspace }}/go/src/github.com/Hi-Windom/Sillot/app/build/Sillot-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
asset_content_type: application/octet-stream
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: zip WinPortable
uses: thedoctor0/zip-release@0.7.1
Expand All @@ -262,17 +271,25 @@ jobs:
exclusions: '*.git*'
recursive_exclusions: 'LICENSES.chromium.html'

- name: Upload WinPortable to release
uses: actions/upload-release-asset@v1
if: contains( matrix.config.goos, 'windows')
- name: Upload WinPortable to release via REST API
if: contains(matrix.config.goos, 'windows')
run: |
asset_name="Sillot-${{ needs.create_release.outputs.release_version }}-win_Portable_.zip"
asset_path="Sillot-${{ needs.create_release.outputs.release_version }}-win_Portable_.zip"
# Calculate the asset size
asset_size=$(stat -c%s "$asset_path")
# Generate the POST URL with asset name
post_url="${{ needs.create_release.outputs.upload_url }}?name=$asset_name"
# Send the POST request with asset data
curl \
-X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$asset_path" \
-H "Content-Length: $asset_size" \
"$post_url"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 这里使用 bot
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: Sillot-${{ needs.create_release.outputs.release_version }}-win_Portable_.zip
asset_path: Sillot-${{ needs.create_release.outputs.release_version }}-win_Portable_.zip
asset_content_type: application/octet-stream
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


# Manual setup is required when the built-in version does not work correctly in windows2022
Expand Down Expand Up @@ -333,13 +350,23 @@ jobs:
# override default build-tools version -- optional
BUILD_TOOLS_VERSION: "34.0.0"

- name: Upload APK to release
uses: actions/upload-release-asset@v1
if: contains( matrix.config.goos, 'windows')
- name: Upload APK to release via REST API
if: contains(matrix.config.goos, 'windows')
run: |
asset_name="Sillot-${{ needs.create_release.outputs.release_version }}-debug.apk"
asset_path="${{steps.sign_app.outputs.signedReleaseFile}}"
upload_url="{{ needs.create_release.outputs.upload_url }}"
# Calculate the asset size
asset_size=$(stat -c%s "$asset_path")
# Generate the POST URL with asset name
post_url="$upload_url?name=$asset_name"
# Send the POST request with asset data
curl \
-X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/vnd.android.package-archive" \
--data-binary "@$asset_path" \
-H "Content-Length: $asset_size" \
"$post_url"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: Sillot-${{ needs.create_release.outputs.release_version }}-debug.apk
asset_path: ${{steps.sign_app.outputs.signedReleaseFile}}
asset_content_type: application/octet-stream
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sillot",
"version": "0.28.8",
"version": "0.28.9",
"syv": "3.0.6",
"sypv": "3.0.5",
"description": "Build Your Eternal Digital Garden",
Expand Down

0 comments on commit 9f37b87

Please sign in to comment.