diff --git a/.github/workflows/bumpdevversion.yml b/.github/workflows/bumpdevversion.yml index 5f2515a9..88703813 100644 --- a/.github/workflows/bumpdevversion.yml +++ b/.github/workflows/bumpdevversion.yml @@ -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 development package source's git revision + - 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