Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run softprops/action-gh-release@v2 Error: ⚠️ GitHub Releases requires a tag #508

Open
BaseMax opened this issue Sep 11, 2024 · 5 comments

Comments

@BaseMax
Copy link

BaseMax commented Sep 11, 2024

      - name: Create tag
        id: create_tag
        run: |
          tag_name="v1.0.${{ github.run_number }}"
          git tag $tag_name
          git push origin $tag_name

      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          files: |
            release/salam-linux
            release/salam-mac
            release/salam-windows.exe
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

image

@BaseMax
Copy link
Author

BaseMax commented Sep 11, 2024

Fixed by adding a tag_name, but the problem and error is: it shows same error even when I am passing the tag_name.

My mistake was I need to keep "v" at beginning of tag_name.

I think it's better to improve error message of this action.

Thanks again.

@VioletGiraffe
Copy link

Thank you for showing how to create a release from a non-tagged commit. Are you required to push the tag? I would prefer to not litter the repo with garbage tags.

@gh-andre
Copy link

@VioletGiraffe

Are you required to push the tag? I would prefer to not litter the repo with garbage tags.

It's not really a tag name but rather a "proposed tag name", which will become an actual tag when the draft release is published. Here's how it's supposed to work:

  • Create a draft release with build artifacts and the proposed tag of the upcoming release (no tag is created at this point)
  • Test artifacts
  • If the tests fail, discard the draft release
  • Fix the problem
  • Run the pipeline again, so it creates another draft release with a new set of artifacts and the same proposed tag
  • Test artifacts
  • If the tests are successful, then publish the release, at which point the proposed tag becomes the real tag

Many people publish their release right away, without the draft release, which is what creates those garbage tags that need to be deleted if tests fail.

@BaseMax
Copy link
Author

BaseMax commented Sep 30, 2024

I fully handled this process in one of my project by getting help from GitHub action and some other packages. here are full source of my showcase:
https://github.com/SalamLang/Salam/blob/main/.github/workflows/build-release.yml

Short brief: I am automatically release and build my compiler/programming language for 3 different OS (Windows, Linux, macOS) This github action is making this process automaticly, we are getting VERSION number from a file which standed in the root and we create tag and release in the github automaticly by using that VERSION number.

Best,
Max

@gh-andre
Copy link

@BaseMax

There's a couple of points you may want to consider with this setup.

The most important one is that build artifacts in this workflow are being released without any testing. So, for the amount of time it takes you to test these artifacts and issue a fix, a buggy version will be tagged and made available through a non-draft release, and perhaps on whatever website that POST request is made to.

You may also want to avoid using latest build images. This will eventually cause compiler compatibility issues when GitHub deploys new build images with new compilers, which may be incompatible with the current source. Typically you'd want to pick a specific GitHub image, like ubuntu-24.04 or windows-2022, so you always know what toolset will be available. When you're ready to move to the next compiler version, only at that time you would pick the new build image in the workflow file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants