GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Set release tag from time and date by SableRaf · Pull Request #431 · processing/processing-website

Conversation

@SableRaf

@SableRaf SableRaf commented Feb 6, 2023

Copy link
Copy Markdown
Collaborator

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
SableRaf added 2 commits February 6, 2023 15:52
@SableRaf
Set release tag from time and date
4c76bc0
Set tag from time and date
@SableRaf
Added seconds to release tag timestamp
279e59a
@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

runemadsen commented Feb 6, 2023

Copy link
Copy Markdown
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 :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@runemadsen

runemadsen commented Feb 6, 2023

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SableRaf

SableRaf commented Feb 6, 2023

Copy link
Copy Markdown
Collaborator Author

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 }}'

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SableRaf

SableRaf commented Feb 6, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@runemadsen

runemadsen commented Feb 6, 2023

Copy link
Copy Markdown
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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SableRaf
Update deploy.yml
930d06e
Changed version to title and tweaked input descriptions
@SableRaf

SableRaf commented Feb 6, 2023

Copy link
Copy Markdown
Collaborator Author

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 :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@runemadsen

runemadsen commented Feb 7, 2023

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SableRaf

SableRaf commented Feb 7, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SableRaf
Update deploy.yml
89b82e0
properly set the GitHub environment variable (untested)
@SableRaf
SableRaf merged commit 2560c35 into main Feb 7, 2023
@SableRaf

SableRaf commented Feb 7, 2023

Copy link
Copy Markdown
Collaborator Author

@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}
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

runemadsen commented Feb 7, 2023

Copy link
Copy Markdown
Member

Great!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@runemadsen runemadsen Awaiting requested review from runemadsen

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@SableRaf @runemadsen
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.