1.10.0 #2
Workflow file for this run
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
name: Publish Release | |
on: | |
release: | |
types: [released] | |
env: | |
NODE_VERSION: '16' | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Prepare Package | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install vsce CLI | |
run: npm i -g @vscode/vsce | |
- name: Publish | |
run: | | |
RELEASE_ID=$(jq -r '.release.id' $GITHUB_EVENT_PATH) | |
ASSETS=$(curl -sS -H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
"https://api.github.com/repos/${{ github.repository }}/releases/$RELEASE_ID/assets") | |
for asset in $(echo "$ASSETS" | jq -r '.[].name'); do | |
if [[ "$asset" == csharpextension* ]]; then | |
echo "Publishing extension: $asset" | |
vsce publish --yarn --pat ${{ secrets.VSCE_PAT }} --package "$asset" | |
fi | |
done | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
GITHUB_EVENT_PATH: ${{ github.event_path }} | |
bump-minor: | |
name: Bump Minor Version | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
- name: Bump version for next release | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
VERSION=$(perl -ne 'while (m|"version"\W+([\d\.]+)|g) {print "$1"}' package.json) | |
NEXT_VERSION=$(echo "$VERSION" | perl -pe 's/^(\d+)(\.)(\d+).*$/$1.$2.($3+1).$2.0/e') | |
echo "Increasing version to $NEXT_VERSION" | |
perl -pi -e "s|(\"version\"\W+)([\d\.]+)|\${1}${NEXT_VERSION}|" package.json | |
git commit -a -m "Increased version after release publication to $NEXT_VERSION [skip ci]" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master |