Skip to content

Commit

Permalink
ci: reuse setup action
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishqmanuja committed Jan 11, 2024
1 parent 63f12e0 commit dbfcb64
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 48 deletions.
38 changes: 38 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Setup Repository
description: Setup Repository and Install dependencies

runs:
using: composite

steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
shell: bash
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup ENV Vars
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "NODE_VERSION=$(cat .node-version)" >> $GITHUB_ENV
- name: Setup Node Stuff
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup Go Stuff
uses: ./.github/actions/setup-go
with:
go-version: "1.21.5"

- name: Install Additional Dependencies
shell: bash
run: |
go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
26 changes: 2 additions & 24 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,8 @@ jobs:
timeout-minutes: 15

steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup ENV Vars
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "NODE_VERSION=$(cat .node-version)" >> $GITHUB_ENV
- name: Setup Node Stuff
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup Go Stuff
uses: ./.github/actions/setup-go
with:
go-version: "1.21.5"
- name: Setup
uses: ./.github/actions/setup

- name: Build
run: pnpm turbo build
Expand Down
26 changes: 2 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,8 @@ jobs:
timeout-minutes: 15

steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup ENV vars
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "NODE_VERSION=$(cat .node-version)" >> $GITHUB_ENV
- name: Setup Node Stuff
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup Go Stuff
uses: ./.github/actions/setup-go
with:
go-version: "1.21.5"
- name: Setup
uses: ./.github/actions/setup

- name: Build & Release
run: pnpm release ${{ github.event.inputs.bump }}
Expand Down

0 comments on commit dbfcb64

Please sign in to comment.