Skip to content

Set release tag from time and date #431

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

Merged
merged 4 commits into from
Feb 7, 2023

Conversation

SableRaf
Copy link
Collaborator

@SableRaf SableRaf commented Feb 6, 2023

Make a unique tag for workflow releases from the time and date.

@SableRaf SableRaf marked this pull request as ready for review February 6, 2023 14:57
@SableRaf SableRaf requested a review from runemadsen February 6, 2023 14:57
@runemadsen
Copy link
Member

Thanks for this! I think it's a good idea to automatically create the version. Can you delete the version input from the action config file? Then, feel free to merge :)

@runemadsen
Copy link
Member

Just saw your comment in Slack. What is the version attribute used for now?

@SableRaf
Copy link
Collaborator Author

SableRaf commented Feb 6, 2023

Just saw your comment in Slack. What is the version attribute used for now?

@runemadsen It is used to set the name of the release: name: 'Website ${{ inputs.version }}'

@SableRaf
Copy link
Collaborator Author

SableRaf commented Feb 6, 2023

Thanks for this! I think it's a good idea to automatically create the version. Can you delete the version input from the action config file? Then, feel free to merge :)

Right now I'm automatically creating the unique tag, not the version name. I'm actually not sure where the idea of having a unique tag for each release started or if it is necessary but I emulated it here.

Automatically generating the version name would be tricky, since we may want to get the website out of Beta at some point, or bump it up from version 7 to 8 at some point and this is subjective and not a decision we can easily automate.

@runemadsen
Copy link
Member

Thanks for that. The unique tag is only needed for the GitHub release, since GitHub uses this to make a Git tag in the current HEAD of the branch. I was just wondering whether we need the version at all if it's only used to populate the release field. Could we just rename it to Release title?

Changed version to title and tweaked input descriptions
@SableRaf
Copy link
Collaborator Author

SableRaf commented Feb 6, 2023

I was just wondering whether we need the version at all if it's only used to populate the release field. Could we just rename it to Release title?

@runemadsen: Gotcha! I made this change. Do these commit look ok? I'm kinda new to the whole GH workflows thing :)

@runemadsen
Copy link
Member

Looks good to me! I've never set an ENV variable like this, but give it a whirl and see how it goes!

@SableRaf
Copy link
Collaborator Author

SableRaf commented Feb 7, 2023

Hmm, yeah that doesn't seem to be the proper way to set env variables. I'll fix this before merging.

Edit: the normal way to set environment variables doesn't work for dynamic variables. this is promising: https://github.com/orgs/community/discussions/26342

properly set the GitHub environment variable (untested)
@SableRaf SableRaf merged commit 2560c35 into main Feb 7, 2023
@SableRaf
Copy link
Collaborator Author

SableRaf commented Feb 7, 2023

@runemadsen It worked! Here's what I ended up with:

- name: Set Tag Name
        run: |
          echo "RELEASE_DATE=$(date '+%Y-%m-%d-%H%M%S')" >> ${GITHUB_ENV}

@SableRaf SableRaf deleted the SableRaf-ProcessingDeployAction-SetTagFromDateTime branch February 7, 2023 11:31
@runemadsen
Copy link
Member

Great!

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

Successfully merging this pull request may close these issues.

2 participants