Skip to content

Commit

Permalink
💚 Modifying CI/CD to be multi-step
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Hand committed Apr 5, 2021
1 parent d26c9d8 commit d0b46a1
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 15 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build Action

on:
pull_request:
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install deps and build
run: npm ci && npm run build
26 changes: 11 additions & 15 deletions .github/workflows/ci.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Publish Action
name: Release Action

on:
push:
branches:
- '*'
tags:
- 'v*'

jobs:
build:
Expand All @@ -22,27 +22,23 @@ jobs:
release:
runs-on: ubuntu-latest
needs: [build]
if: ${{ contains(fromJSON('["refs/heads/dev", "refs/heads/master"]'), github.ref) }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Tag new version
id: tag
uses: clevyr/release-it-tagger-action@v21.4.1
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Download build
uses: actions/download-artifact@v2
with:
name: dist
- name: Get version
id: version
run: |
version_file="VERSION"
version=`cat "$version_file"`
echo ::set-output name=version::"$version"
- name: Create a GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.tag.outputs.version }}"
release_name: "Release ${{ steps.tag.outputs.new_tag }}"
tag_name: "v${{ steps.version.outputs.version }}"
release_name: "Release ${{ steps.version.outputs.version }}"
23 changes: 23 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tag Action

on:
pull_request:
branches:
- 'master'
- 'dev'
types:
- 'closed'

jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Tag new version
id: tag
uses: clevyr/release-it-tagger-action@v24.4.1

0 comments on commit d0b46a1

Please sign in to comment.