-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from gjsjohnmurray/bump-vsce
bump some dependencies
- Loading branch information
Showing
4 changed files
with
9,578 additions
and
3,212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,17 @@ on: | |
branches: | ||
- master | ||
paths-ignore: | ||
- 'docs/**' | ||
- '.vscode/**' | ||
- '.github/**' | ||
- '*.md' | ||
- '**/*.md' | ||
- "docs/**" | ||
- ".vscode/**" | ||
- ".github/**" | ||
- "*.md" | ||
- "**/*.md" | ||
pull_request: | ||
branches: | ||
- master | ||
release: | ||
types: | ||
- created | ||
- released | ||
jobs: | ||
build: | ||
timeout-minutes: 10 | ||
|
@@ -24,143 +24,153 @@ jobs: | |
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Set an output | ||
id: set-version | ||
if: runner.os == 'Linux' | ||
run: | | ||
set -x | ||
VERSION=$(jq -r '.version' package.json | cut -d- -f1) | ||
[ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/} | ||
CHANGELOG=$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d') | ||
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | ||
echo ::set-output name=changelog::$CHANGELOG | ||
git tag -l | cat | ||
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1)) | ||
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }} | ||
echo ::set-output name=version::$VERSION | ||
NAME=$(jq -r '.name' package.json)-$VERSION | ||
echo ::set-output name=name::$NAME | ||
tmp=$(mktemp) | ||
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json | ||
mkdir dist | ||
echo $VERSION > ./dist/.version | ||
echo $NAME > ./dist/.name | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- run: npm install | ||
- name: lint | ||
if: runner.os == 'Linux' | ||
run: npm run lint | ||
- run: npm run compile | ||
- name: npm test | ||
uses: GabrielBB/[email protected] | ||
with: | ||
run: npm run test | ||
- name: Build package | ||
if: runner.os == 'Linux' | ||
run: | | ||
./node_modules/.bin/vsce package -o ./dist/${{ steps.set-version.outputs.name }}.vsix | ||
- uses: actions/upload-artifact@v2 | ||
if: runner.os == 'Linux' | ||
with: | ||
name: vsix | ||
path: | | ||
./dist/${{ steps.set-version.outputs.name }}.vsix | ||
./dist/.name | ||
./dist/.version | ||
- uses: actions/checkout@v2 | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Set an output | ||
id: set-version | ||
if: runner.os == 'Linux' | ||
run: | | ||
set -x | ||
VERSION=$(jq -r '.version' package.json | cut -d- -f1) | ||
[ $GITHUB_EVENT_NAME == 'release' ] && VERSION=${{ github.event.release.tag_name }} && VERSION=${VERSION/v/} | ||
CHANGELOG=$(cat CHANGELOG.md | sed -n "/## \[${VERSION}\]/,/## /p" | sed '/^$/d;1d;$d') | ||
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | ||
echo ::set-output name=changelog::$CHANGELOG | ||
git tag -l | cat | ||
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=-beta && VERSION+=.$(($(git tag -l "v$VERSION.*" | sort -nt. -k4 2>/dev/null | tail -1 | cut -d. -f4)+1)) | ||
[ $GITHUB_EVENT_NAME == 'pull_request' ] && VERSION+=-dev.${{ github.event.pull_request.number }} | ||
echo ::set-output name=version::$VERSION | ||
NAME=$(jq -r '.name' package.json)-$VERSION | ||
echo ::set-output name=name::$NAME | ||
tmp=$(mktemp) | ||
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json | ||
mkdir dist | ||
echo $VERSION > .version | ||
echo $NAME > .name | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
- run: npm install | ||
- name: lint | ||
if: runner.os == 'Linux' | ||
run: npm run lint | ||
- run: npm run compile | ||
- name: npm test | ||
uses: GabrielBB/[email protected] | ||
with: | ||
run: npm run test | ||
- name: Build package | ||
if: runner.os == 'Linux' | ||
run: | | ||
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix | ||
- uses: actions/upload-artifact@v2 | ||
if: runner.os == 'Linux' | ||
with: | ||
name: ${{ steps.set-version.outputs.name }}.vsix | ||
path: ${{ steps.set-version.outputs.name }}.vsix | ||
- uses: actions/upload-artifact@v2 | ||
if: runner.os == 'Linux' | ||
with: | ||
name: meta | ||
path: | | ||
.name | ||
.version | ||
beta: | ||
if: (github.event_name == 'push') | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: vsix | ||
path: ./dist/ | ||
- name: Set an output | ||
id: set-version | ||
if: runner.os == 'Linux' | ||
run: | | ||
set -x | ||
echo ::set-output name=version::`cat ./dist/.version` | ||
echo ::set-output name=name::`cat ./dist/.name` | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
if: runner.os == 'Linux' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.set-version.outputs.version }} | ||
release_name: v${{ steps.set-version.outputs.version }} | ||
prerelease: ${{ github.event_name != 'release' }} | ||
body: | | ||
Changes in this release | ||
${{ steps.set-version.outputs.changelog }} | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
if: runner.os == 'Linux' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./dist/${{ steps.set-version.outputs.name }}.vsix | ||
asset_name: ${{ steps.set-version.outputs.name }}.vsix | ||
asset_content_type: application/zip | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: meta | ||
path: . | ||
- name: Set an output | ||
id: set-version | ||
if: runner.os == 'Linux' | ||
run: | | ||
set -x | ||
echo ::set-output name=version::`cat .version` | ||
echo ::set-output name=name::`cat .name` | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ steps.set-version.outputs.name }}.vsix | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
if: runner.os == 'Linux' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.set-version.outputs.version }} | ||
release_name: v${{ steps.set-version.outputs.version }} | ||
prerelease: ${{ github.event_name != 'release' }} | ||
body: | | ||
Changes in this release | ||
${{ steps.set-version.outputs.changelog }} | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
if: runner.os == 'Linux' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ steps.set-version.outputs.name }}.vsix | ||
asset_name: ${{ steps.set-version.outputs.name }}.vsix | ||
asset_content_type: application/zip | ||
publish: | ||
if: github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
token: ${{ secrets.TOKEN }} | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: vsix | ||
path: ./dist/ | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Prepare build | ||
id: set-version | ||
run: | | ||
VERSION=`cat ./dist/.version` | ||
NEXT_VERSION=`cat ./dist/.version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.` | ||
echo ::set-output name=name::`cat ./dist/.name` | ||
tmp=$(mktemp) | ||
git config --global user.name 'ProjectBot' | ||
git config --global user.email '[email protected]' | ||
jq --arg version "${NEXT_VERSION}-SNAPSHOT" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json | ||
git add package.json | ||
git commit -m 'auto bump version with release' | ||
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json | ||
jq '.enableProposedApi = false' package.json > "$tmp" && mv "$tmp" package.json | ||
npm install | ||
git push | ||
echo ::set-output name=ovsx::`cat ./dist/.name` | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
if: runner.os == 'Linux' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./dist/${{ steps.set-version.outputs.name }}.vsix | ||
asset_name: ${{ steps.set-version.outputs.name }}.vsix | ||
asset_content_type: application/zip | ||
- name: Publish to VSCode Marketplace | ||
run: | | ||
[ -n "${{ secrets.VSCE_TOKEN }}" ] && ./node_modules/.bin/vsce publish -p ${{ secrets.VSCE_TOKEN }} || true | ||
- name: Publish to Open VSX Registry | ||
run: | | ||
[ -n "${{ secrets.OVSX_TOKEN }}" ] && ./node_modules/.bin/ovsx publish --pat ${{ secrets.OVSX_TOKEN }} || true | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
token: ${{ secrets.TOKEN }} | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: meta | ||
path: . | ||
- name: Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14.x | ||
- name: Prepare build | ||
id: set-version | ||
run: | | ||
VERSION=`cat .version` | ||
NEXT_VERSION=`cat .version | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.` | ||
echo ::set-output name=name::`cat .name` | ||
tmp=$(mktemp) | ||
git config --global user.name 'ProjectBot' | ||
git config --global user.email '[email protected]' | ||
jq --arg version "${NEXT_VERSION}-SNAPSHOT" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json | ||
git add package.json | ||
git commit -m 'auto bump version with release' | ||
jq --arg version "$VERSION" '.version = $version' package.json > "$tmp" && mv "$tmp" package.json | ||
jq '.enableProposedApi = false' package.json > "$tmp" && mv "$tmp" package.json | ||
npm install | ||
git push | ||
- name: Build package | ||
run: | | ||
npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
if: runner.os == 'Linux' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.set-version.outputs.name }}.vsix | ||
asset_name: ${{ steps.set-version.outputs.name }}.vsix | ||
asset_content_type: application/zip | ||
- name: Publish to VSCode Marketplace | ||
run: | | ||
[ -n "${{ secrets.VSCE_TOKEN }}" ] && \ | ||
npx vsce publish --packagePath ${{ steps.set-version.outputs.name }}.vsix -p ${{ secrets.VSCE_TOKEN }} || true | ||
- name: Publish to Open VSX Registry | ||
run: | | ||
[ -n "${{ secrets.OVSX_TOKEN }}" ] && \ | ||
npx ovsx publish ${{ steps.set-version.outputs.name }}.vsix --pat ${{ secrets.OVSX_TOKEN }} || true |
Oops, something went wrong.