Code Monkey home page Code Monkey logo

Comments (4)

anton-yurchenko avatar anton-yurchenko commented on May 28, 2024 2

Uhm I got you, my bad!
I will add wildcard support in the next release.

As per artifacts download, it sure looks like a good addition that should be implemented.
I think the following pattern might work:

      - name: Release
        uses: docker://antonyurchenko/git-release:latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DRAFT_RELEASE: "false"
          PRE_RELEASE: "false"
          CHANGELOG_FILE: "CHANGELOG.md"
          ALLOW_EMPTY_CHANGELOG: "false"
          ALLOW_TAG_PREFIX: "true"
        with:
          args: |                   # <artifact-name>:<filename-pattern>
            job1:release/app.exe    # single file from artifact
            job2:build/*.dll        # wildcard matching in an artifact
            job3:*                  # every file from an artifact
            LICENSE.md              # file from current workspace
            *.jpg                   # wildcard matching in current workspace

from git-release.

anton-yurchenko avatar anton-yurchenko commented on May 28, 2024

I understand your point, and to be honest, I think its kind of a common need to collect artifacts from different parallel stages.

I believe that each action should take care of a certain task, and only that small task in order to be simple, generic, and reliable.

That matrix that you are describing looks like a usecase for another Action to be made 🙂 an alternative to actions/download-artifact 😉

That artifact preparing action has enough to take care of like filename collisions, multiple artifacts download, moving files around and preparing a file tree, maybe even creating archives and cleaning the GitHub Artifacts in order to lower the Packages billing, and more...

Moreover, independent action will also simplify the matrix definition as it will have clean args and env that may be used for that.

from git-release.

reitzig avatar reitzig commented on May 28, 2024

I think you've misunderstood my request because I can't make heads nor tails of your response. 😅

My problem isn't with assembling the artifact(s), that's well taken care of and I give it for background.
The issue is that I can't tell git-release to use any artifact I've assembled.

Note that wildcards like args: "my-asset_*_.tar.gz also doesn't work. That would be another alternative to consider, but the real goal here is to get rid of download-artifact+hack.

from git-release.

anton-yurchenko avatar anton-yurchenko commented on May 28, 2024

Unfortunately, download artifacts seems to be problematic for implementation.
The reason for that is that artifacts are not available during a workflow run through API, but only after it finishes.

Going through a code of an official actions/download-artifact, I have noticed that it uses a different API and auth.
git-release may mimic this by crafting an API calls that will look similar to:
https://pipelines.actions.githubusercontent.com/<actions-token>/_apis/pipelines/workflows/<workflow-run>/artifacts?api-version=6.0-preview
But it will break without a notice

Thus, we will have to rely on other steps to prepare the files for a release, with something like:

jobs:
  job-1:
    runs-on: ubuntu-latest
    steps:
      [...]

      - uses: actions/upload-artifact@v2
        with:
          name: linux
          path: build/linux-amd64

  job-2:
    runs-on: macos-latest
    steps:
      [...]

      - uses: actions/upload-artifact@v2
        with:
          name: darwin
          path: build/darwin-amd64
  
  job-3:
    runs-on: windows-latest
    steps:
      [...]

      - uses: actions/upload-artifact@v2
        with:
          name: darwin
          path: build/windows-amd64.exe

  release:
    needs: [job-1, job-2, job-3]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v2
        with:
          name: linux
          path: artifacts
      
      - uses: actions/download-artifact@v2
        with:
          name: macos
          path: artifacts
      
      - uses: actions/download-artifact@v2
        with:
          name: windows
          path: artifacts

      - name: Release
        uses: docker://antonyurchenko/git-release:latest
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CHANGELOG_FILE: none
          ALLOW_EMPTY_CHANGELOG: "true"
          ALLOW_TAG_PREFIX: "true"
        with:
          args: artifacts/build/*-amd64*

from git-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.