Skip to content

Commit

Permalink
Don't create the same release twice (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x6675636b796f75676974687562 authored Nov 14, 2022
1 parent ec8e5f2 commit 816c94e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/bindist-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
release-version:
required: true
type: string
upload-url:
required: true
type: string

jobs:
dist:
Expand Down Expand Up @@ -62,25 +65,14 @@ jobs:
if-no-files-found: error
retention-days: 1

- id: create_release
if: ${{ github.ref_type == 'tag' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ inputs.release-version }}
draft: false
prerelease: false

- name: Upload release asset (${{ steps.filenames.outputs.diktat-cli-tgz }})
id: upload-release-asset-tgz
if: ${{ github.ref_type == 'tag' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ inputs.upload-url }}
asset_path: ${{ steps.filenames.outputs.diktat-cli-tgz }}
asset_name: ${{ steps.filenames.outputs.diktat-cli-tgz }}
asset_content_type: application/gzip
Expand All @@ -92,7 +84,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ inputs.upload-url }}
asset_path: ${{ steps.filenames.outputs.diktat-cli-zip }}
asset_name: ${{ steps.filenames.outputs.diktat-cli-zip }}
asset_content_type: application/zip
18 changes: 5 additions & 13 deletions .github/workflows/bindist-thin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
release-version:
required: true
type: string
upload-url:
required: true
type: string

jobs:
dist:
Expand Down Expand Up @@ -50,25 +53,14 @@ jobs:
if-no-files-found: error
retention-days: 1

- id: create_release
if: ${{ github.ref_type == 'tag' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ inputs.release-version }}
draft: false
prerelease: false

- name: Upload release asset (${{ steps.filenames.outputs.diktat-cli-tgz }})
id: upload-release-asset-tgz
if: ${{ github.ref_type == 'tag' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ inputs.upload-url }}
asset_path: ${{ steps.filenames.outputs.diktat-cli-tgz }}
asset_name: ${{ steps.filenames.outputs.diktat-cli-tgz }}
asset_content_type: application/gzip
Expand All @@ -80,7 +72,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: ${{ inputs.upload-url }}
asset_path: ${{ steps.filenames.outputs.diktat-cli-zip }}
asset_name: ${{ steps.filenames.outputs.diktat-cli-zip }}
asset_content_type: application/zip
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,30 @@ jobs:
echo "release-version=${RELEASE_VERSION}" >>"${GITHUB_OUTPUT}"
shell: bash

- id: release
name: Create the release
if: ${{ github.ref_type == 'tag' }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: v${{ steps.version.outputs.release-version }}
draft: false
prerelease: false

outputs:
release-version: ${{ steps.version.outputs.release-version }}
upload-url: ${{ steps.release.outputs.upload_url }}

bindist-thin:
name: Binary distribution (thin)
needs: [ version ]
uses: ./.github/workflows/bindist-thin.yml
with:
release-version: ${{ needs.version.outputs.release-version }}
upload-url: ${{ needs.version.outputs.upload-url }}
secrets: inherit

bindist-full:
Expand All @@ -54,6 +69,7 @@ jobs:
uses: ./.github/workflows/bindist-full.yml
with:
release-version: ${{ needs.version.outputs.release-version }}
upload-url: ${{ needs.version.outputs.upload-url }}
secrets: inherit

move-tag:
Expand Down

0 comments on commit 816c94e

Please sign in to comment.