Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get prerelease working #8648

Merged
merged 17 commits into from
Jan 6, 2022
14 changes: 13 additions & 1 deletion .github/actions/build-vsix/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: 'Build VSIX'
description: "Build the extension's VSIX"

inputs:
package_command:
description: 'Package.json package script'
required: false
default: 'package'
outputs:
path:
description: 'Path to the VSIX'
Expand All @@ -12,6 +17,13 @@ runs:
- run: npm ci --prefer-offline
shell: bash

- name: Echo inputs
shell: bash
run: |
echo "Building package with method: ${{inputs.package_command}}"



# Use the GITHUB_RUN_ID environment variable to update the build number.
# GITHUB_RUN_ID is a unique number for each run within a repository.
# This number does not change if you re-run the workflow run.
Expand All @@ -23,5 +35,5 @@ runs:
# - run: npm run updateBuildNumber -- --buildNumber $GITHUB_RUN_ID --updateChangelog
# shell: bash

- run: npm run package
- run: npm run ${{ inputs.package_command }}
shell: bash
17 changes: 15 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,29 @@ jobs:
vsix_name: ${{ env.vsix_name }}
test_matrix_os: ${{ env.test_matrix_os }}
release_channel: ${{ env.release_channel }}
package_command: ${{ env.package_command }}
if: github.repository == 'microsoft/vscode-jupyter'
steps:
- name: dump_event
uses: crazy-max/ghaction-dump-context@v1

- name: default_package
run: |
echo "Event_name is ${{ github.event_name }}"
echo "Ref is ${{ github.ref }}"
echo "package_command=package" >> $GITHUB_ENV


- name: pr
if: github.event_name == 'pull_request'
run: |
echo "vsix_name=ms-toolsai-jupyter-insiders.vsix" >> $GITHUB_ENV
echo "test_matrix_os=[\"ubuntu-latest\"]" >> $GITHUB_ENV

- name: pr release push
if: github.event_name == 'pull_request' && contains(github.event.body, 'publish')
run: |
echo "release_channel=stable" >> $GITHUB_ENV
echo "package_command=packagePreRelease" >> $GITHUB_ENV

- name: pre-release
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/main'
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
Expand All @@ -91,6 +101,7 @@ jobs:
# Scheduled builds will publish pre-release builds.
if: github.event_name == 'schedule' && github.ref == 'refs/heads/main'
run: |
echo "package_command=packagePreRelease" >> $GITHUB_ENV
echo "release_channel=pre-release" >> $GITHUB_ENV

- name: release
Expand Down Expand Up @@ -139,6 +150,8 @@ jobs:

- name: Build VSIX
uses: ./.github/actions/build-vsix
with:
package_command: ${{ needs.pick_environment.outputs.package_command }}
id: build-vsix

- name: Rename VSIX for release branch
Expand Down