-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate deployments to GitHub Actions
- Loading branch information
1 parent
0352d72
commit 9057516
Showing
5 changed files
with
73 additions
and
68 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
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
env: | ||
OWNER: scala | ||
REPOSITORY: vscode-scala-syntax | ||
RELEASE_BRANCH: master | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
- 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: npx github-changes --owner $OWNER --repository $REPOSITORY --branch $RELEASE_BRANCH --no-merges --title "Scala Syntax (official) Changelog" | ||
- run: yarn build | ||
- run: yarn test | ||
- 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: npx github-changes --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 |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.