我想知道如何从Github Actions下载构建文件。所以主要的问题是,我是一个windows用户,我想为mac用户构建我的应用程序。但是没有简单的方法可以做到这一点,所以我使用Github Actions为mac用户构建应用程序。它运行成功,但我如何下载构建文件。Link to the Github Repo
发布于 2020-12-15 16:28:47
构建完成后,您应该首先使用actions/upload-release-asset
GitHub操作上载刚刚构建的发布资产。
在Yevhenii Babichenko的"Automated multi-platform releases with GitHub Actions “中有一个完整的示例
# ...
release_assets:
name: Release assets
needs: create_release # we need to know the upload URL
runs-on: ${{ matrix.config.os }} # we run many different builds
strategy:
# just an example matrix
matrix:
config:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
steps:
# checkout of cource
- name: Checkout code
uses: actions/checkout@v1
# ... whatever build and packaging steps you need here
# and finally do an upload!
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
# This is how it will be named on the release page. Put hatever name
# you like, remember that they need to be different for each platform.
# You can choose any build matrix parameters. For Rust I use the
# target triple.
asset_name: program-name-${{ matrix.config.os }}
# The path to the file you want to upload.
asset_path: ./path/to/your/file
# probably you will need to change it, but most likely you are
# uploading a binary file
asset_content_type: application/octet-stream
只有当这些资产上传到GitHub时,您才可以考虑使用downloading them。
https://stackoverflow.com/questions/65300378
复制相似问题