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

Chore: GitHub actions #3

Merged
merged 2 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Extension (Reusable WF)

on:
workflow_call:
inputs:
update-type:
required: true
type: string
secrets:
WIN_PAT:
required: true
PAT:
required: true

permissions:
contents: write

jobs:
publish-extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.WIN_PAT }}
- name: Setup Node v16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Install node packages
run: yarn install
- name: Setup Git User
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
- name: Publish extension
run: vsce publish ${{ inputs.update-type }} --pat ${{ secrets.PAT }} --allow-missing-repository
- name: Push Version
run: git push origin
67 changes: 67 additions & 0 deletions .github/workflows/triggerPublishing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Publish Extension

on:
pull_request:
types:
- closed
branches:
- main

permissions:
contents: write

jobs:
isPatch:
name: Check if label is patch
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'patch')
runs-on: ubuntu-latest
steps:
- name: Job Check Report
run: echo Found a patch label
isMinor:
name: Check if label is minor
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'minor')
runs-on: ubuntu-latest
steps:
- name: Job Check Report
run: echo Found a minor label
isMajor:
name: Check if label is major
if: |
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'major')
runs-on: ubuntu-latest
steps:
- name: Job Check Report
run: echo Found a major label
update-patch:
name: Performs patch update
needs: isPatch
uses: ./.github/workflows/publish.yaml
with:
update-type: patch
secrets:
WIN_PAT: ${{ secrets.WIN_PAT_1 }}
PAT: ${{ secrets.PAT_VSC_MARKETPLACE }}
update-minor:
name: Performs patch update
needs: isMinor
uses: ./.github/workflows/publish.yaml
with:
update-type: minor
secrets:
WIN_PAT: ${{ secrets.WIN_PAT_1 }}
PAT: ${{ secrets.PAT_VSC_MARKETPLACE }}
update-major:
name: Performs major update
needs: isMajor
uses: ./.github/workflows/publish.yaml
with:
update-type: major
secrets:
WIN_PAT: ${{ secrets.WIN_PAT_1 }}
PAT: ${{ secrets.PAT_VSC_MARKETPLACE }}