build: Add release action #230
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: Codicons Build | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16' | |
- name: Install dependencies | |
run: npm install | |
- name: Build font | |
run: npm run build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: codicon-font-${{ github.sha }} | |
path: dist/codicon.ttf | |
# Create a release when a new tag is pushed. Writes out all new commit messages since the last release. | |
- name: Create Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
commits=$(git log --pretty=format:"- %h: %s%n (%H)%n" ${{ github.event.before }}..${{ github.sha }}) | |
echo "This release includes: ${commits}" > commit_messages.txt | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
body: $(cat commit_messages.txt) | |
# run: | | |
# git config --global user.email "[email protected]" | |
# git config --global user.name "GitHub Actions" | |
# git clone https://github.com/microsoft/vscode.git | |
# cd vscode | |
# git checkout -b update-codonicons | |
# cp -r ../dist/codicon.ttf src/vs/base/browser/ui/codicons/codicon/ | |
# git add . | |
# git commit -m "Update codicons to ${{ github.ref }}" | |
# git push origin update-font | |
# # TODO: Create PR |