簡體   English   中英

Github - 將工件提交到存儲庫

[英]Github - Commit artifact to repository

我正在使用 drools 並希望有一個工作流在拉取請求時觸發 Ant 構建並將生成的 jar 文件保存到存儲庫。

我已經運行 ant 構建並生成工件,但是有什么方法可以將該文件作為拉取請求的一部分提交回 repo。

# This is a basic workflow to help you get started with Actions

name: Run ant build

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the production branch
  pull_request:
    branches:
      - production
      - develop

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v2
        with:
          java-version: '11'
          distribution: 'adopt'

      - run: ant -noinput -buildfile satbuild.xml
      - uses: actions/upload-artifact@v2
        with:
          name: fileName
          path: fileName.jar

如果您真的想保存工件,那么您應該查看git-lfs 但是,將二進制文件提交到存儲庫通常被認為是不好的做法。 如果您需要將其作為構建的一部分,請考慮將其托管在GitHub Packages 上

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM