|
1 |
| -name: Release Obsidian Plugin |
| 1 | +name: Release Obsidian plugin |
| 2 | + |
2 | 3 | on:
|
3 | 4 | push:
|
4 | 5 | tags:
|
5 | 6 | - '*'
|
| 7 | + |
6 | 8 | jobs:
|
7 | 9 | build:
|
8 | 10 | runs-on: ubuntu-latest
|
| 11 | + |
9 | 12 | steps:
|
10 |
| - - uses: actions/checkout@v2 |
11 |
| - with: |
12 |
| - fetch-depth: 0 # otherwise, you will failed to push refs to dest repo |
| 13 | + - uses: actions/checkout@v3 |
| 14 | + |
13 | 15 | - name: Use Node.js
|
14 |
| - uses: actions/setup-node@v1 |
| 16 | + uses: actions/setup-node@v3 |
15 | 17 | with:
|
16 |
| - node-version: '14.x' |
17 |
| - - name: Get Version |
18 |
| - id: version |
19 |
| - run: | |
20 |
| - echo "::set-output name=tag::$(git describe --abbrev=0)" |
21 |
| - - name: Build |
22 |
| - id: build |
| 18 | + node-version: '18.x' |
| 19 | + |
| 20 | + - name: Build plugin |
23 | 21 | run: |
|
24 |
| - yarn |
25 |
| - yarn run build |
26 |
| - # Create the release on github |
27 |
| - - name: Create Release |
28 |
| - id: create_release |
29 |
| - uses: actions/create-release@v1 |
| 22 | + npm install |
| 23 | + npm run build |
| 24 | +
|
| 25 | + - name: Create release |
30 | 26 | env:
|
31 | 27 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
32 |
| - VERSION: ${{ github.ref }} |
33 |
| - with: |
34 |
| - tag_name: ${{ github.ref }} |
35 |
| - release_name: ${{ github.ref }} |
36 |
| - draft: false |
37 |
| - prerelease: false |
38 |
| - # Upload the main.js |
39 |
| - - name: Upload main.js |
40 |
| - id: upload-main |
41 |
| - uses: actions/upload-release-asset@v1 |
42 |
| - env: |
43 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
44 |
| - with: |
45 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
46 |
| - asset_path: ./main.js |
47 |
| - asset_name: main.js |
48 |
| - asset_content_type: text/javascript |
49 |
| - # Upload the manifest.json |
50 |
| - - name: Upload manifest.json |
51 |
| - id: upload-manifest |
52 |
| - uses: actions/upload-release-asset@v1 |
53 |
| - env: |
54 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
55 |
| - with: |
56 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
57 |
| - asset_path: ./manifest.json |
58 |
| - asset_name: manifest.json |
59 |
| - asset_content_type: application/json |
60 |
| - # Upload the style.css |
61 |
| - - name: Upload styles.css |
62 |
| - id: upload-css |
63 |
| - uses: actions/upload-release-asset@v1 |
64 |
| - env: |
65 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
66 |
| - with: |
67 |
| - upload_url: ${{ steps.create_release.outputs.upload_url }} |
68 |
| - asset_path: ./styles.css |
69 |
| - asset_name: styles.css |
70 |
| - asset_content_type: text/css |
| 28 | + run: | |
| 29 | + tag="${GITHUB_REF#refs/tags/}" |
| 30 | +
|
| 31 | + gh release create "$tag" \ |
| 32 | + --title="$tag" \ |
| 33 | + --notes-file="release-notes.md" \ |
| 34 | + main.js manifest.json styles.css |
0 commit comments