From 7695f9646be3199cb364fdeba07cbb466f0d70a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Bokvad=20Engar=C3=A5s?= Date: Mon, 2 Oct 2023 09:59:44 +0200 Subject: [PATCH] refactor project --- .github/workflows/release.yml | 62 +++-------------------------------- 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c309cbf4..6890c89c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,63 +1,9 @@ -name: Creating Release - +name: Creating release +run-name: ${{ github.actor }} creating a release on: pull_request: types: [closed] jobs: - release: - if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install dependencies and build - run: npm ci && npm run build - - - name: 'Get latest release tag' - id: latest_release - run: | - current_version=`gh release list --limit 30 | grep Latest | awk '{ print $1;}'` - if [ -z "$current_version" ] - then - echo "No release found" - echo "Creating tag for firt release" - echo "version=v1.0.0" >> $GITHUB_ENV - else - echo "version=${current_version}" >> $GITHUB_ENV - fi - env: - GH_TOKEN: ${{ github.token }} - - - name: Display version - run: | - # Display the version from the environment - echo "Latest Version: ${{ env.version }}" - - - id: label - uses: zwaldowski/match-label-action@v4 - with: - allowed: major,minor,patch - default_match: none - - - uses: actions-ecosystem/action-bump-semver@v1 - if: ${{ steps.label.outputs.match != 'none' }} - id: bump-semver - with: - current_version: ${{ env.version }} - level: ${{steps.label.outputs.match}} - - - name: 'Creating Release' - if: ${{ steps.label.outputs.match != 'none' }} - run: | - gh release create ${{ steps.bump-semver.outputs.new_version }} --title " ${{ steps.bump-semver.outputs.new_version }}" --generate-notes - env: - GH_TOKEN: ${{ github.token }} - - - uses: JasonEtco/build-and-tag-action@v2 - if: ${{ steps.label.outputs.match != 'none' }} - env: - GITHUB_TOKEN: ${{ github.token }} - with: - tag_name: ${{ steps.bump-semver.outputs.new_version }} + call-release-workflow: + uses: omegapoint/cydig-reusable-workflows/.github/workflows/release.yml@main