diff --git a/.github/workflows/build-workflow.yml b/.github/workflows/build-workflow.yml index f2e6beba..b822e7ef 100644 --- a/.github/workflows/build-workflow.yml +++ b/.github/workflows/build-workflow.yml @@ -4,6 +4,11 @@ on: outputs: artifact-name: value: ${{ jobs.build.outputs.artifact-name }} + inputs: + pre_release: + required: false + type: boolean + default: false jobs: build: @@ -21,7 +26,7 @@ jobs: run: npm ci - name: "Create Artifact" - run: npx vsce package + run: npx vsce package ${{ inputs.pre_release && '--pre-release' || ''}} - name: "Resolve build version" run: echo "BUILD_VERSION=$GITHUB_SHA" >> $GITHUB_ENV diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61d94a57..bdbb0191 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,15 @@ name: 👷 CI on: + push: + branches: main workflow_dispatch: jobs: build: name: "🛠️ Build" uses: ./.github/workflows/build-workflow.yml + with: + pre_release: true deploy: name: "🚀 Publish" @@ -13,4 +17,5 @@ jobs: uses: ./.github/workflows/deploy-workflow.yml with: artifact: ${{ needs.build.outputs.artifact-name }} + pre_release: true secrets: inherit diff --git a/.github/workflows/deploy-workflow.yml b/.github/workflows/deploy-workflow.yml index 36257eb4..3081e4f3 100644 --- a/.github/workflows/deploy-workflow.yml +++ b/.github/workflows/deploy-workflow.yml @@ -5,6 +5,10 @@ on: artifact: required: true type: string + pre_release: + required: false + type: boolean + default: false jobs: Deploy: @@ -16,6 +20,6 @@ jobs: name: ${{ inputs.artifact }} - name: Publish - run: npx vsce publish --pat $VSCE_PAT --packagePath $(find . -iname *.vsix) + run: npx vsce publish ${{ inputs.pre_release && '--pre-release' || ''}} --pat $VSCE_PAT --packagePath $(find . -iname *.vsix) env: VSCE_PAT: ${{ secrets.VSCE_PAT }}