Merge pull request #270 from tgodzik/revert #19
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: deploy | |
on: | |
push: | |
tags: | |
- "*.*.*" | |
env: | |
OWNER: scala | |
REPOSITORY: vscode-scala-syntax | |
RELEASE_BRANCH: main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "14" | |
- name: Cache Node.js modules | |
uses: actions/cache@v2 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
- run: yarn | |
- name: Update package.json version | |
run: yarn version --no-git-tag-version --new-version ${GITHUB_REF#refs/*/} | |
- name: Generate CHANGELOG.md | |
run: yarn run github-changes --token ${{ secrets.GITHUB_TOKEN }} --owner $OWNER --repository $REPOSITORY --branch $RELEASE_BRANCH --no-merges --title "Scala Syntax (official) Changelog" | |
- run: yarn build | |
- run: yarn test | |
# Comment this out if it causes problems... | |
- name: Commit generated files | |
run: | | |
git config --global user.name "Scala bot" | |
git config --global user.email "$GITHUB_RUN_NUMBER@$GITHUB_SHA" | |
git commit -am "Release ${GITHUB_REF#refs/*/}" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
git push origin HEAD:$RELEASE_BRANCH | |
- name: Release extension | |
run: yarn vscode:publish --pat ${{ secrets.VS_MARKETPLACE_TOKEN }} | |
- name: Generate GitHub Release notes | |
run: yarn run github-changes --token ${{ secrets.GITHUB_TOKEN }} --owner $OWNER --repository $REPOSITORY --branch $RELEASE_BRANCH --no-merges --title "Changelog" --for-tag ${GITHUB_REF#refs/*/} --file release-notes.md | |
- name: Create GitHub Release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body_path: release-notes.md | |
draft: false | |
prerelease: false | |
- run: mv scala-*.vsix scala.vsix | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: ./scala.vsix | |
asset_name: scala.vsix | |
asset_content_type: application/zip |