-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update package version to format like 6.1.0_abcdefg_20XX.MM.DD
- Loading branch information
Showing
1 changed file
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,15 +17,29 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
# 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/[email protected] | ||
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 development package source's git revision | ||
- name: Update package source's git revision | ||
uses: mikefarah/[email protected] | ||
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 | ||
|