Skip to content

Commit

Permalink
implemented new composite action
Browse files Browse the repository at this point in the history
Also set up the version to add a `v`
  • Loading branch information
Bullrich committed Sep 29, 2023
1 parent 24ed30a commit ede4ebb
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,11 @@ 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 }}

tag:
if: github.event_name == 'push' && needs.test-versions.outputs.version != ''
Expand All @@ -80,7 +64,7 @@ jobs:
- uses: mukunku/[email protected]
id: checkTag
with:
tag: ${{ needs.test-versions.outputs.version }}
tag: v${{ needs.test-versions.outputs.version }}
- run: echo ${{ steps.checkTag.outputs.exists }}
- uses: actions/[email protected]
- name: Tag version and create release
Expand Down Expand Up @@ -117,4 +101,4 @@ jobs:
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
env:
TAG: ${{ needs.test-versions.outputs.version }}
TAG: v${{ needs.test-versions.outputs.version }}

0 comments on commit ede4ebb

Please sign in to comment.