Skip to content

Commit

Permalink
Artifact upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoah1 committed Jun 13, 2024
1 parent e227507 commit 7849caa
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
build:
Expand All @@ -22,4 +23,22 @@ jobs:
cache: 'yarn'
- run: yarn install
- run: yarn test:ci
- run: yarn package
- name: Package the extension
id: package
# Uploaded extension name will include the version and current git sha.
run: |
yarn package
PACKAGE_PATH=$(find . -name 'vscode-bazel-bsp-*.vsix')
PACKAGE_NAME_WITH_SHA="${PACKAGE_PATH%.vsix}-$(echo $GITHUB_SHA | cut -c1-7).vsix"
echo "package_path=$PACKAGE_PATH" >> $GITHUB_ENV
echo "package_name_with_sha=$(basename $PACKAGE_NAME_WITH_SHA)" >> $GITHUB_ENV
upload-artifact:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
needs: build
runs-on: ubuntu-latest
steps:
- name: Upload packaged extension artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.package_name_with_sha }}
path: ${{ env.package_path }}

0 comments on commit 7849caa

Please sign in to comment.