How to adjust automagic release naming by tag? #149475
Replies: 2 comments 1 reply
-
By default, GitHub creates release archives with the tag name and places the repository contents in a folder named after the repository. For example:
This might not be logical for many users, especially when they want more meaningful naming like Possible Solutions1. Pre-release Script (Manual Approach)You can create a release script (e.g., a shell script) that:
Here’s an example of what the script might look like: # Example shell script to manually create a release archive
git tag progeny-1.2
git archive --format=tar.gz -o progeny-1.2.tar.gz HEAD
# Optionally rename the archive or folder structure here
# Upload the resulting tar.gz file manually via the GitHub UI 2. Automating with GitHub ActionsYou can create a GitHub Actions workflow to automate the release process. This way, you can control the naming conventions, including the archive name and folder structure. Here’s an example GitHub Actions workflow ( name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create custom release archive
run: |
# Create archive with desired structure
mkdir -p release
git archive --format=tar.gz -o release/progeny-1.2.tar.gz HEAD
# Add your custom logic here to rename files or structure
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: release/progeny-1.2.tar.gz This workflow:
3. Feature RequestIf this feature is essential for your workflow, consider submitting a feature request to GitHub: |
Beta Was this translation helpful? Give feedback.
-
Thank you for such detailed answer. It was this bad. All these hurdles to get such a simple thing.
Sure I can do that, but it means adding another tarball to the basket. It also may be confusing, as well as unnecessary duplication and waste of resources. Mine and Github's.
I thought I was on community discussion. If that means contacting Support then it's going to be painful. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
How to adjust automagic release naming by tag
This automagic release naming by tag is, for lack of better word, far-fetched and illogical.
How can one, and why is is not available, to control released archive and repository name?
Imagine one wants to issue a release of their program called
progeny
. Their repository isuser/progeny
and the program version and therefore tag put in release box isv1.2
.The released program archive will be called
v1.2.zip
(or .tar.gz), which doesn't mean anything.Now user, taught by their first/previous release/s, wanted the file to have a more meaningful name, including a program name, put a full program and version name in a tag:
progeny-1.2
. Now the archive is concededly calledprogeny-1.2.zip
but repository inside is called (sic!)progeny-progeny-1.2
.Why on Earth, can't it be called
progeny-1.2.zip
withprogeny-1.2
inside? That would be logical. The way it is now -v1.2.zip
with repositoryprogeny-1.2/
inside - is not.Can user control it?
If not, then can I ask for such a, de facto, trivial feature?
Beta Was this translation helpful? Give feedback.
All reactions