首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何从github actions下载构建文件?

如何从github actions下载构建文件?
EN

Stack Overflow用户
提问于 2020-12-15 13:17:39
回答 1查看 404关注 0票数 1

我想知道如何从Github Actions下载构建文件。所以主要的问题是,我是一个windows用户,我想为mac用户构建我的应用程序。但是没有简单的方法可以做到这一点,所以我使用Github Actions为mac用户构建应用程序。它运行成功,但我如何下载构建文件。Link to the Github Repo

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-15 16:28:47

构建完成后,您应该首先使用actions/upload-release-asset GitHub操作上载刚刚构建的发布资产。

Yevhenii Babichenko的"Automated multi-platform releases with GitHub Actions “中有一个完整的示例

代码语言:javascript
运行
复制
# ...
  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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65300378

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档