forked from paritytech/get-fellows-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also set up the version to add a `v`
- Loading branch information
Showing
1 changed file
with
5 additions
and
21 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 |
---|---|---|
|
@@ -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 != '' | ||
|
@@ -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 | ||
|
@@ -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 }} |