Skip to content

Commit

Permalink
fix: use environment file to manage outputs (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
rlespinasse committed Oct 15, 2022
1 parent dc6696e commit 38b657f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-that.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
concurrency:
group: os-testing-${{ github.ref }}-${{ github.event_name }}
group: os-testing-${{ github.ref }}-${{ github.event_name }}-${{ matrix.os }}
cancel-in-progress: true
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# test 1
- name: Test 'dry-run' input
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
concurrency:
group: release-${{ github.ref }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Release That
uses: ./
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
INPUT_WITHOUTPREFIX: ${{ inputs.without-prefix }}
- name: Semantic Release
id: semantic-release
uses: cycjimmy/semantic-release-action@v2
uses: cycjimmy/semantic-release-action@v3
with:
dry_run: ${{ inputs.dry-run }}
extra_plugins: |
Expand Down
12 changes: 6 additions & 6 deletions major-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

if [ "${INPUT_MAJORTAG}" == "false" ]; then
echo "Major Tag publication disabled, skipping it."
echo "::set-output name=major_tag_published::false"
echo "major_tag_published=false" >> "$GITHUB_OUTPUT"
exit 0
fi

if [ "${NEW_RELEASE_PUBLISHED}" == "false" ]; then
echo "No new release published, skipping major tag publication."
echo "::set-output name=major_tag_published::false"
echo "major_tag_published=false" >> "$GITHUB_OUTPUT"
exit 0
fi

Expand All @@ -18,7 +18,7 @@ if [ "${INPUT_MAJORTAG}" == "auto" ]; then
echo "It's a GitHub Action."
else
echo "No conditions met, skipping major tag publication."
echo "::set-output name=major_tag_published::false"
echo "major_tag_published=false" >> "$GITHUB_OUTPUT"
exit 0
fi
fi
Expand All @@ -29,12 +29,12 @@ if [ "${INPUT_WITHOUTPREFIX}" == "true" ]; then
fi

echo "Publication of v${NEW_RELEASE_MAJOR_VERSION} based on ${tag_name}"
echo "::set-output name=major_tag::v${NEW_RELEASE_MAJOR_VERSION}"
echo "major_tag=v${NEW_RELEASE_MAJOR_VERSION}" >> "$GITHUB_OUTPUT"

if [ "${INPUT_DRYRUN}" == "false" ]; then
git push origin "${tag_name}:v${NEW_RELEASE_MAJOR_VERSION}" --force || {
echo "::set-output name=major_tag_published::false"
echo "major_tag_published=false" >> "$GITHUB_OUTPUT"
exit 1
}
fi
echo "::set-output name=major_tag_published::true"
echo "major_tag_published=true" >> "$GITHUB_OUTPUT"

0 comments on commit 38b657f

Please sign in to comment.