Skip to content

Commit

Permalink
Dedup Release Workflows (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyKh committed Jul 25, 2023
1 parent 340d2bf commit 1c92b18
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 54 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/build-and-tag.yaml

This file was deleted.

35 changes: 34 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ name: Last commit

on: [push]


jobs:
build:
runs-on: ubuntu-latest
outputs:
should-commit-status: ${{ contains(steps.can_commit.outputs.commit_result, 'nothing to commit') == false }}

strategy:
matrix:
Expand Down Expand Up @@ -56,4 +59,34 @@ jobs:
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
branch: ${{ github.ref_name }}


# this job will only run if steps.check.outputs.triggered == 'true'
# you just need to write the if once
tag:
runs-on: ubuntu-latest
needs: [build]
if: needs.build.outputs.should-commit-status == 'true'
steps:

- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
append_to_pre_release_tag: ''
default_bump: false
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: New release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: 'dist/person-entity-card-bundle.js'
body: ${{ steps.tag_version.outputs.changelog }}
commit: 'main'
name: Release ${{ steps.tag_version.outputs.new_tag }}
owner: 'GuyKh'
repo: 'person-entity-card'
tag: ${{ steps.tag_version.outputs.new_tag }}
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1c92b18

Please sign in to comment.