-
Notifications
You must be signed in to change notification settings - Fork 182
65 lines (56 loc) · 1.83 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Create a release when a new tag is pushed
name: Codicons Release
on:
push:
branches: [ main ]
tags:
- '*' # Only runs on annotated tags
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # All history
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Build font
run: npm run build
- name: Write release notes
if: startsWith(github.ref, 'refs/tags/')
run: | # List all commits since last tag
commits=$(git log --pretty=format:"* %s (%h)" $(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)...)
echo -e "This release includes:\n${commits}" > release_notes.txt
{
echo 'release_notes<<EOF'
cat release_notes.txt
echo EOF
} >> "$GITHUB_ENV"
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
body: ${{ env.release_notes }}
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/codicon.ttf
asset_name: codicon-font-${{ github.ref_name }}.ttf
asset_content_type: application/x-font-ttf