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

Update publish workflow, version and preview flag #135

Merged
merged 1 commit into from
Sep 20, 2024
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
58 changes: 23 additions & 35 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,26 @@ jobs:
runs-on: ubuntu-latest

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

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install Dependencies
run: npm ci

- name: Install VSCE
run: npm install -g vsce

- name: Update version and default in package.json
run: |
TAG_NAME=${{ github.ref_name }}
VERSION=${TAG_NAME#v}
VERSION=${VERSION%-beta}
if [[ "$TAG_NAME" == *"-beta"* ]]; then
jq --arg version "$VERSION" --arg default "beta" '.version = $version | .contributes.configuration.properties["dev-proxy-toolkit.version"].default = $default' package.json > package.tmp.json
else
jq --arg version "$VERSION" --arg default "stable" '.version = $version | .contributes.configuration.properties["dev-proxy-toolkit.version"].default = $default' package.json > package.tmp.json
fi
mv package.tmp.json package.json

- name: Publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [[ "$TAG_NAME" == *"-beta"* ]]; then
vsce publish --pre-release
else
vsce publish
fi
- name: Checkout code
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x

- name: Install Dependencies
run: npm ci

- name: Install VSCE
run: npm install -g vsce

- name: Publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [[ "${GITHUB_REF}" == *"-beta" ]]; then
vsce publish --pre-release
else
vsce publish
fi
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "dev-proxy-toolkit",
"displayName": "Dev Proxy Toolkit",
"description": "Makes it easy to create and update Dev Proxy configuration files.",
"version": "0.8.0",
"version": "0.9.0",
"publisher": "garrytrinder",
"engines": {
"vscode": "^1.85.0"
Expand Down Expand Up @@ -130,7 +130,7 @@
}
}
},
"preview": true,
"preview": false,
"pricing": "Free",
"icon": "dist/icon.png",
"homepage": "https://github.com/garrytrinder/dev-proxy-toolkit/blob/main/README.md",
Expand Down