Skip to content

Commit

Permalink
Update package version to format like 6.1.0_abcdefg_20XX.MM.DD
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Jul 28, 2020
1 parent ee41a73 commit 9606d3e
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/bumpdevversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,29 @@ jobs:
uses: actions/checkout@v2.3.1

# Get latest GMT sha hash from Github
- name: Get git revision number
- name: Get latest git revision number, tag version and commit date
id: git_rev_info
run: echo ::set-output name=sha::$(git ls-remote /~https://github.com/GenericMappingTools/gmt HEAD | cut -f 1)
run: |
# Get full SHA value (e.g. abcdefghijklmnopqrstuvwxyz12345678901234)
echo ::set-output name=full_sha::$(git ls-remote /~https://github.com/GenericMappingTools/gmt HEAD | cut -f 1)
# Get shortened SHA value (e.g abcdefg)
echo ::set-output name=short_sha::$(git ls-remote /~https://github.com/GenericMappingTools/gmt HEAD | cut -c 1-7)
# Get tag with highest version number (e.g. 1.2.3)
echo ::set-output name=latest_tag::$(git ls-remote -q --sort="-version:refname" --tags --refs /~https://github.com/GenericMappingTools/gmt | head -n 1 | cut -d / -f 3)
# Get date of latest commit
# TODO
# Change Github sha hash
- name: Update git revision number
# Change development package version
- name: Update package version
uses: mikefarah/yq@3.3.2
with:
cmd: "yq write --inplace recipe/meta.yaml 'source.git_rev' ${{ steps.git_rev_info.outputs.sha }}"
cmd: "yq write --inplace recipe/meta.yaml 'package.version' ${{ steps.git_rev_info.outputs.latest_tag }}_${{ steps.git_rev_info.outputs.short_sha }}_20XX.MM.DD"

# Change
- name: Update package source's git revision
uses: mikefarah/yq@3.3.2
with:
cmd: "yq write --inplace recipe/meta.yaml 'source.git_rev' ${{ steps.git_rev_info.outputs.full_sha }}"

# Take a look at recipe/meta.yaml contents
- name: Check meta.yaml contents
Expand Down

0 comments on commit 9606d3e

Please sign in to comment.