|
2 | 2 | release:
|
3 | 3 | types:
|
4 | 4 | - created
|
| 5 | + push: |
| 6 | + tags: |
| 7 | + - redcode-v* |
5 | 8 |
|
6 | 9 | defaults:
|
7 | 10 | run:
|
8 | 11 | working-directory: redcode
|
9 | 12 |
|
| 13 | +env: |
| 14 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 15 | + |
10 | 16 | jobs:
|
11 | 17 | publish:
|
12 |
| - if: startsWith(github.ref, "refs/tags/redcode-") |
| 18 | + if: startsWith(github.ref, 'refs/tags/redcode-v') |
13 | 19 | runs-on: ubuntu-latest
|
14 | 20 | steps:
|
15 | 21 | - name: Checkout
|
16 | 22 | uses: actions/checkout@v2
|
17 |
| - - name: Set version string |
18 |
| - id: get_name |
19 |
| - run: echo "::set-output name=PACKAGE::$(echo '${{ github.ref }}' | awk -F '[/]' '{print $3}').vsix" |
| 23 | + - name: Get Release |
| 24 | + id: get_release |
| 25 | + uses: bruceadams/[email protected] |
| 26 | + - name: Get release tag |
| 27 | + id: get_version |
| 28 | + run: echo "::set-output name=package::$(echo ${{ github.ref }} | cut -d '/' -f 3)" |
20 | 29 | - name: Install Node.js
|
21 | 30 | uses: actions/setup-node@v1
|
22 | 31 | with:
|
23 | 32 | node-version: 10.x
|
24 | 33 | - name: Install dependencies
|
25 | 34 | run: npm install
|
26 | 35 | - name: Package extension
|
27 |
| - run: npm run package -- --out ${{ steps.get_name.outputs.PACKAGE }} |
| 36 | + run: npm run package -- --out ${{ steps.get_version.outputs.package }}.vsix |
28 | 37 | - name: Upload extension to Github
|
29 | 38 | uses: actions/upload-release-asset@v1
|
30 |
| - env: |
31 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
32 | 39 | with:
|
33 |
| - upload_url: ${{ github.event.upload_url }} |
34 |
| - asset_path: ./${{ steps.get_name.outputs.PACKAGE }} |
35 |
| - asset_name: ${{ steps.get_name.outputs.PACKAGE }} |
| 40 | + upload_url: ${{ steps.get_release.outputs.upload_url }} |
| 41 | + asset_path: redcode/${{ steps.get_version.outputs.package }}.vsix |
| 42 | + asset_name: ${{ steps.get_version.outputs.package }}.vsix |
36 | 43 | asset_content_type: application/vsix
|
37 | 44 | - name: Publish extension to VSCode marketplace
|
38 | 45 | run: npm run deploy
|
|
0 commit comments