I'm trying to create automatic releases of a project using GitHub Actions where the release tag is based on the date. I don't want to use standard semantic versioning because this project is a fork of another project that uses date-based versioning. I've found posts about the getting the date in a workflow and have this so far:
name: Publish
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
publish:
name: Publish release of font files
runs-on: ubuntu-latest
steps:
- name: Create foo file
run: |
mkdir cascadios
> cascadios/foo.txt
- name: Get tag name from date
id: tag_name
run: echo "::set-output name=date::$(date +'%y%m.%d')"
- name: Zip font files
run: |
cd cascadios
zip ../cascadios-${{ steps.tag_name.outputs.date }}.zip *
cd ..
- name: Create tag
uses: mathieudutour/github-tag-action@v6.0
id: tag_version
with:
github_token: ${{ github.token }}
custom_tag: ${{ steps.tag_name.outputs.date }}
Note: I have it creating a blank file to release to save the 15 minutes of building.
This works great until I have two releases in one day (such as today where I am testing this workflow a lot). How can I get it so I can add a dynamic patch number to the tag, so it doesn't cause a conflict? An example might look like v2112.13.0.