-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use gh cmdline tool to create and delete releases.
- Loading branch information
Showing
1 changed file
with
22 additions
and
49 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 |
---|---|---|
|
@@ -52,60 +52,33 @@ jobs: | |
working-directory: ${{ inputs.checkout-directory }} | ||
run: ${{ inputs.build-script }} | ||
|
||
- name: Delete Latest Release and Tag | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | ||
uses: dev-drprasad/[email protected] | ||
with: | ||
delete_release: true | ||
tag_name: "latest" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Latest Tag | ||
- name: Release Latest | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | ||
working-directory: ${{ inputs.checkout-directory }} | ||
run: | | ||
gh release delete latest --cleanup-tag || true | ||
git tag -d latest || true | ||
git push --delete origin refs/tags/latest || true | ||
git tag latest | ||
git push origin latest | ||
- id: release_latest | ||
name: Release Latest | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifactErrorsFailBuild: true | ||
artifacts: ${{ env.DIST_DIR }}/* | ||
generateReleaseNotes: true | ||
makeLatest: true | ||
name: "Latest (unstable)" | ||
prerelease: true | ||
tag: "latest" | ||
git push --force origin refs/tags/latest | ||
gh release create latest "$DIST_DIR"/* \ | ||
--generate-notes \ | ||
--title "Latest (unstable)" \ | ||
--verify-tag \ | ||
--prerelease | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- id: release_tag | ||
name: Release Tag | ||
uses: ncipollo/release-action@v1 | ||
- name: Release Tag | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
allowUpdates: true | ||
artifactErrorsFailBuild: true | ||
artifacts: ${{ env.DIST_DIR }}/* | ||
body: ${{ inputs.release-notes }} | ||
draft: false | ||
generateReleaseNotes: true | ||
makeLatest: true | ||
omitBodyDuringUpdate: true | ||
omitDraftDuringUpdate: true | ||
omitNameDuringUpdate: true | ||
omitPrereleaseDuringUpdate: true | ||
|
||
- name: Show release outputs | ||
shell: bash | ||
working-directory: ${{ inputs.checkout-directory }} | ||
run: | | ||
echo 'id: ' | ||
echo -n '${{ steps.release_tag.outputs.id }}' | ||
echo -n '${{ steps.release_latest.outputs.id }}' | ||
echo '' | ||
echo '' | ||
echo 'url:' | ||
echo -n '${{ steps.release_tag.outputs.html_url }}' | ||
echo -n '${{ steps.release_latest.outputs.html_url }}' | ||
echo '' | ||
gh release delete "$GITHUB_REF_NAME" || true | ||
gh release create "$GITHUB_REF_NAME" "$DIST_DIR"/* \ | ||
--generate-notes \ | ||
--notes "$RELEASE_NOTES" \ | ||
--verify-tag \ | ||
--latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RELEASE_NOTES: ${{ inputs.release-notes }} |