diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml new file mode 100644 index 0000000..4423046 --- /dev/null +++ b/.github/workflows/create-release.yaml @@ -0,0 +1,21 @@ +name: "Generate Release" + +on: + workflow_dispatch: + inputs: + version: + description: "Tag Version x.x.x" + required: true + type: string +jobs: + publish: + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: Generate Release + run: | + gh release create \ + -t "Release v${{ github.event.inputs.version }}" \ + --generate-notes \ + --draft \ + "v${{ github.event.inputs.version }}" diff --git a/.github/workflows/create-tag.yaml b/.github/workflows/create-tag.yaml deleted file mode 100644 index 69c8ec6..0000000 --- a/.github/workflows/create-tag.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: "Generate Tag" - -on: - workflow_dispatch: - inputs: - version: - description: "Tag Version x.x.x" - required: true - type: string -jobs: - publish: - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Create Tag - uses: actions/github-script@v6 - with: - script: | - github.rest.git.createRef({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: 'refs/tags/v${{ github.event.inputs.version }}', - sha: context.sha - }) diff --git a/.github/workflows/release.yaml b/.github/workflows/publish-image.yaml similarity index 69% rename from .github/workflows/release.yaml rename to .github/workflows/publish-image.yaml index 4ebc3e3..5825d3e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/publish-image.yaml @@ -56,34 +56,3 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max - release: - needs: build-and-push-image - name: "Release" - if: github.ref_type == 'tag' - runs-on: "ubuntu-latest" - - steps: - - name: "Determine tag" - run: 'echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV' - - - name: "Create release" - uses: "actions/github-script@v6" - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - script: | - try { - const response = await github.rest.repos.createRelease({ - draft: false, - generate_release_notes: true, - name: process.env.RELEASE_TAG, - owner: context.repo.owner, - prerelease: false, - repo: context.repo.repo, - tag_name: process.env.RELEASE_TAG, - }); - - core.exportVariable('RELEASE_ID', response.data.id); - core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url); - } catch (error) { - core.setFailed(error.message); - }