-
-
Notifications
You must be signed in to change notification settings - Fork 99
Add major-minor-release workflow #45
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
base: unstable/v1
Are you sure you want to change the base?
Changes from 1 commit
e34653e
b78d2e9
5baaafc
54e3ca6
5fbbe92
1ef704e
bf26813
aabe83c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import sys | ||
|
||
from packaging.version import parse | ||
|
||
print(sys.version_info) | ||
tag_ref = sys.argv[1] | ||
tag_name = tag_ref.split("/")[-1] | ||
print(f"tag_name: {tag_name}") | ||
version = parse(tag_name) | ||
print(f"version: {version}") | ||
if not (version.is_prerelease): | ||
print("Creating new major and minor tags!") | ||
print(f"::set-output name=original_tag_name::{tag_name}") | ||
print(f"::set-output name=major_version::v{version.major}") | ||
print(f"::set-output name=minor_version::v{version.major}.{version.minor}") | ||
webknjaz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else: | ||
print("No tags created (dev or pre version)!") |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,33 @@ | ||||||||||||||||||
name: "Publish Major-Minor-Tags" | ||||||||||||||||||
on: | ||||||||||||||||||
push: | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, I'm lately preferring the WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mostly use I guess semantically the closes would be to use on:
release:
types: [published] I use this trigger for my actions and it works fine, but I'm not sure how this will play out with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The usage of on:
create:
jobs:
job-name:
if: github.event.ref_type == 'tag' # to filter out branch creation (because it doesn't have "native" filters) I usually create the tags using local Git and push them from CLI. And only after that I publish releases. So I'm not sure if Also, I'm fine with publishing pre-releases to Marketplace. I've done it before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think auto-publishing is a bit too much automation since the release messages often need some handcrafted work. e.g. markdown formatting, which can't be extracted from the tag. As for the As for the semantics of on:
push:
tags:
- "v*" gives you the same functionality as on:
create:
jobs:
job-name:
if: github.event.ref_type == 'tag' && startsWith( github.ref, 'v') There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about the markdown part. First of all, it's possible to have tag annotations with markdown baked-in but I wouldn't care about it too much: when you mark a release as published to the Marketplace, the new version appears there but the release description does not show up there. Instead, it just contains README content. |
||||||||||||||||||
tags: | ||||||||||||||||||
- "v*" | ||||||||||||||||||
|
||||||||||||||||||
jobs: | ||||||||||||||||||
push-tags: | ||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||
steps: | ||||||||||||||||||
- uses: actions/checkout@v2 | ||||||||||||||||||
- name: Set up Python 3.8 | ||||||||||||||||||
uses: actions/setup-python@v2 | ||||||||||||||||||
with: | ||||||||||||||||||
python-version: 3.8 | ||||||||||||||||||
Comment on lines
+12
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess it's time to bump this
Suggested change
|
||||||||||||||||||
- name: Install packaging | ||||||||||||||||||
run: pip install -U packaging | ||||||||||||||||||
s-weigand marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
- name: Get versions | ||||||||||||||||||
id: get_versions | ||||||||||||||||||
run: python .github/workflows/publish-major-minor.py ${{ github.ref }} | ||||||||||||||||||
s-weigand marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
- name: Push Tags Version | ||||||||||||||||||
s-weigand marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
if: steps.get_versions.outputs.original_tag_name != '' | ||||||||||||||||||
s-weigand marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
env: | ||||||||||||||||||
original_tag_name: ${{ steps.get_versions.outputs.original_tag_name }} | ||||||||||||||||||
major_version: ${{ steps.get_versions.outputs.major_version }} | ||||||||||||||||||
minor_version: ${{ steps.get_versions.outputs.minor_version }} | ||||||||||||||||||
run: | | ||||||||||||||||||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||||||||||||||||||
git config --global user.name "github-actions[bot]" | ||||||||||||||||||
s-weigand marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
git tag -a $major_version -m "original tag: $original_tag_name" | ||||||||||||||||||
git tag -a $minor_version -m "original tag: $original_tag_name" | ||||||||||||||||||
s-weigand marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
git push origin $major_version -f | ||||||||||||||||||
git push origin $minor_version -f | ||||||||||||||||||
s-weigand marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.