Skip to content

Commit

Permalink
updating the release job
Browse files Browse the repository at this point in the history
Signed-off-by: Savitha Raghunathan <saveetha13@gmail.com>
  • Loading branch information
savitharaghunathan committed Oct 3, 2024
1 parent ee5b896 commit 9a0bd48
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/ci-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@ on:
- "main"
- "release-*"
workflow_dispatch:
inputs:
shouldRelease:
description: 'Should a release be created?'
required: false
default: 'false'

workflow_call:
inputs:
shouldRelease:
type: boolean
description: 'Should a release be created?'
required: false
default: false


concurrency:
group: ci-repo-${{ github.event_name }}-${{ github.ref }}
Expand Down Expand Up @@ -154,23 +166,33 @@ jobs:
name: Release
runs-on: ubuntu-latest
needs: package
if: github.ref == 'refs/heads/main'
if:
github.ref == 'refs/heads/main' &&
(github.event.inputs.shouldRelease == 'true' || github.event.inputs.shouldRelease == true)

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: "vscode/.nvmrc"

- name: Download VSIX artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts

- name: Generate tag name
- name: Read version from package.json
id: get_version
run: echo "version=$(node -p \"require('./package.json').version\")" >> $GITHUB_OUTPUT

- name: Generate tag name with timestamp
id: vars
shell: bash
run: |
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-8)
TAG_NAME="v0.0.1-dev-${SHORT_SHA}"
TAG_NAME="v${{ steps.get_version.outputs.version }}-dev+$(date +%Y%m%d)"
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
- name: Create Pre-release
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nightly-ci-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ on:
jobs:
nightly:
uses: ./.github/workflows/ci-repo.yml
with:
shouldRelease: true

0 comments on commit 9a0bd48

Please sign in to comment.