From 154a0a90505bd3a7b6760f0d6b93c202a6c6c18f Mon Sep 17 00:00:00 2001 From: Arnaud Mengus Date: Wed, 28 Aug 2024 08:44:00 +0000 Subject: [PATCH] chore: Add GitHub Actions workflow to create releases --- .github/workflows/build.yml | 8 ++++---- .github/workflows/create_release.yml | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/create_release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 32201a2..34777a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: with: gradle-version: 8.7 - # Create Release Semver + # Create Tag Semver - name: Get the current branch name id: get_branch run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV @@ -58,7 +58,7 @@ jobs: fi - name: Display Version Incrementer run: echo "Version Incrementer == ${{ env.versionIncrementer }}" - - name: Create Release + - name: Create Tag if: | github.ref == 'refs/heads/main' && github.repository == 'isontheline/vscode-sysmon' @@ -75,8 +75,8 @@ jobs: npm run vscode:prepublish npm run package - # Push Release - - name: Push Release + # Push Tag + - name: Push Tag if: | github.ref == 'refs/heads/main' && github.repository == 'isontheline/vscode-sysmon' diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml new file mode 100644 index 0000000..c0b93ae --- /dev/null +++ b/.github/workflows/create_release.yml @@ -0,0 +1,21 @@ +name: Create release +on: + push: + tags: + - v* +permissions: + contents: write +jobs: + release: + name: Release pushed tag + runs-on: ubuntu-22.04 + steps: + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + run: | + gh release create "$tag" \ + --repo="$GITHUB_REPOSITORY" \ + --title="${GITHUB_REPOSITORY#*/} ${tag#v}" \ + --generate-notes \ No newline at end of file