Skip to content

Commit

Permalink
Merge pull request #99 from kohbis/call_release_action
Browse files Browse the repository at this point in the history
update: release action by called workflow
  • Loading branch information
kohbis authored Sep 15, 2022
2 parents 9d42671 + 7227121 commit a84eb91
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CD

on:
Expand All @@ -22,6 +23,9 @@ jobs:
tagging:
runs-on: ubuntu-20.04
needs: spec
outputs:
release: ${{ steps.check_head_branch.outputs.match }}
git_tag: ${{ steps.git_tag.outputs.git_tag }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -32,11 +36,19 @@ jobs:
echo ::set-output name=match::true
fi
- name: Git Tag
if: steps.check_head_branch.outputs.match == 'true' && github.event.pull_request.merged == true
id: git_tag
if: ${{ steps.check_head_branch.outputs.match }} == 'true' && ${{ github.event.pull_request.merged }} == true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.head_ref }}
run: |
git tag $TAG_NAME
git push origin $TAG_NAME
echo ::set-output name=git_tag::$TAG_NAME
call-workflow-passing-data:
needs: tagging
if: ${{ needs.tagging.outputs.release }} == 'true' && ${{ github.event.pull_request.merged }} == true
uses: kohbis/rslack/.github/workflows/release.yml@main
with:
git_tag: ${{ needs.tagging.outputs.git_tag }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CI

on: pull_request
Expand All @@ -13,4 +14,3 @@ jobs:
run: cargo fmt -- --check
- name: Run tests
run: cargo test --verbose

6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
---
name: Release

on:
push:
tags:
- 'v*.*.*'
on: workflow_call

jobs:
publish-release:
Expand Down

0 comments on commit a84eb91

Please sign in to comment.