[英]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.