Skip to content

Commit bb07eb3

Browse files
Use get-release and fix action syntax
1 parent 9eac1e3 commit bb07eb3

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

.github/workflows/redcode-publish.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,44 @@ on:
22
release:
33
types:
44
- created
5+
push:
6+
tags:
7+
- redcode-v*
58

69
defaults:
710
run:
811
working-directory: redcode
912

13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
1016
jobs:
1117
publish:
12-
if: startsWith(github.ref, "refs/tags/redcode-")
18+
if: startsWith(github.ref, 'refs/tags/redcode-v')
1319
runs-on: ubuntu-latest
1420
steps:
1521
- name: Checkout
1622
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)"
2029
- name: Install Node.js
2130
uses: actions/setup-node@v1
2231
with:
2332
node-version: 10.x
2433
- name: Install dependencies
2534
run: npm install
2635
- 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
2837
- name: Upload extension to Github
2938
uses: actions/upload-release-asset@v1
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3239
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
3643
asset_content_type: application/vsix
3744
- name: Publish extension to VSCode marketplace
3845
run: npm run deploy

0 commit comments

Comments
 (0)