Skip to content

Commit

Permalink
implemented new composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich committed Sep 29, 2023
1 parent 24ed30a commit 13dc85b
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,32 @@ jobs:
- name: Extract package.json version
id: package_version
run: echo "VERSION=$(jq '.version' -r package.json)" >> $GITHUB_OUTPUT
- name: Extract action.yml version
uses: mikefarah/yq@master
id: action_image
with:
cmd: yq '.runs.image' 'action.yml'
- name: Parse action.yml version
id: action_version
run: |
echo "IMAGE_VERSION=$(echo $IMAGE_URL | cut -d: -f3)" >> $GITHUB_OUTPUT
env:
IMAGE_URL: ${{ steps.action_image.outputs.result }}
- name: Compare versions
id: verification
if: steps.action_version.outputs.IMAGE_VERSION != 'Dockerfile'
run: |
echo "Verifying that $IMAGE_VERSION from action.yml is the same as $PACKAGE_VERSION from package.json"
[[ $IMAGE_VERSION == $PACKAGE_VERSION ]]
echo VERSION="v$PACKAGE_VERSION" >> $GITHUB_OUTPUT
env:
IMAGE_VERSION: ${{ steps.action_version.outputs.IMAGE_VERSION }}
PACKAGE_VERSION: ${{ steps.package_version.outputs.VERSION }}
uses: Bullrich/compare-version-on-action@main
with:
version: ${{ steps.package_version.outputs.VERSION }}
# - name: Extract action.yml version
# uses: mikefarah/yq@master
# id: action_image
# with:
# cmd: yq '.runs.image' 'action.yml'
# - name: Parse action.yml version
# id: action_version
# run: |
# echo "IMAGE_VERSION=$(echo $IMAGE_URL | cut -d: -f3)" >> $GITHUB_OUTPUT
# env:
# IMAGE_URL: ${{ steps.action_image.outputs.result }}
# - name: Compare versions
# id: verification
# if: steps.action_version.outputs.IMAGE_VERSION != 'Dockerfile'
# run: |
# echo "Verifying that $IMAGE_VERSION from action.yml is the same as $PACKAGE_VERSION from package.json"
# [[ $IMAGE_VERSION == $PACKAGE_VERSION ]]
# echo VERSION="v$PACKAGE_VERSION" >> $GITHUB_OUTPUT
# env:
# IMAGE_VERSION: ${{ steps.action_version.outputs.IMAGE_VERSION }}
# PACKAGE_VERSION: ${{ steps.package_version.outputs.VERSION }}

tag:
if: github.event_name == 'push' && needs.test-versions.outputs.version != ''
Expand Down

0 comments on commit 13dc85b

Please sign in to comment.