如何使用 github actions 添加存档文件以进行发布?

发布于 2025-01-10 05:29:33 字数 1308 浏览 0 评论 0原文

我正在尝试添加一个工件文件,并在通过在 github 操作上推送标签来触发时将 DEPLOY.md 文件从子目录添加到发行版。 这是我的工作流程代码

---
name: Module Three Task Three
on:
   push:
   schedule:
      - cron: '0 0 * * *'
jobs:
   Explore-GitHub-Actions:
      runs-on: ubuntu-latest
      steps:
         - name: Checkout
           uses: actions/checkout@v2
         - name: Clone
           run: |
              git clone https://github.com/mittsahl/validation
         - name: Hugo
           run: |
              brew install hugo
         - name: Create package
           run: |
              cd validation/module3_task3
              make build
              make package
         - name: Archive artifacts
           uses: actions/upload-artifact@v2
           with:
             path: |
               validation/module3_task3/awesome-website.zip
         - name: Release
           uses: softprops/action-gh-release@v1
           if: startsWith(github.ref, 'refs/tags/')
           with:
            files: |
              DEPLOY.md
              awesome-website.zip

zip 文件 Awesome-website.zip 和 DEPLOY.md 位于目录 valid/module3_task3/ 中。 我可以通过推送标签和 Awesome-website.zip 存档来创建发行版,但它只是为我提供了发行版中整个存储库的 zip 文件。我想要的只是 DEPLOY.md 和工件或 Awesome-website.zip 文件。当我查看 github 操作时,它给了我一条消息,

Run softprops/action-gh-release@v1

              

I am trying to add an artifact file, and DEPLOY.md file from a sub directory to a release when triggered by pushing tag on github actions.
Here is my code for the work flow

---
name: Module Three Task Three
on:
   push:
   schedule:
      - cron: '0 0 * * *'
jobs:
   Explore-GitHub-Actions:
      runs-on: ubuntu-latest
      steps:
         - name: Checkout
           uses: actions/checkout@v2
         - name: Clone
           run: |
              git clone https://github.com/mittsahl/validation
         - name: Hugo
           run: |
              brew install hugo
         - name: Create package
           run: |
              cd validation/module3_task3
              make build
              make package
         - name: Archive artifacts
           uses: actions/upload-artifact@v2
           with:
             path: |
               validation/module3_task3/awesome-website.zip
         - name: Release
           uses: softprops/action-gh-release@v1
           if: startsWith(github.ref, 'refs/tags/')
           with:
            files: |
              DEPLOY.md
              awesome-website.zip

The zip file awesome-website.zip and DEPLOY.md are in the directory validation/module3_task3/.
I can create the release on the push of a tag and the archive of awesome-website.zip, but it just gives me a zip file of the entire repo in the release. What I want is only the DEPLOY.md and artifact or awesome-website.zip file. When I look in the github actions it gives me the message

Run softprops/action-gh-release@v1
???? Pattern 'DEPLOY.md' does not match any files.
???? Pattern 'awesome-website.zip' does not match any files.
????‍???? Creating new GitHub release for tag 1.0.0...
???? Release ready at https://github.com/mittsahl/validation/releases/tag/1.0.0
???? DEPLOY.md,awesome-website.zip not include valid file.

I have tried giving it the full path to those files each without any success. Any input would be greatly appreciated. Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文