Skip to content

Commit 88f88c8

Browse files
authored
Merge pull request #145 from xsnippet/gh-actions-again
Few GitHub Actions enhancements
2 parents bbe10c5 + e359016 commit 88f88c8

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: release
22

33
on:
44
push:
@@ -12,10 +12,10 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-node@v2
15-
- run: |
16-
npm install
17-
npm run build
18-
tar cvzf dist.tar.gz -C dist/ .
15+
- run: npm install
16+
- run: npm run build
17+
- run: tar cvzf dist.tar.gz -C dist/ .
18+
- run: echo "GIT_TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
1919
- uses: actions/create-release@v1
2020
id: create_release
2121
env:
@@ -25,9 +25,8 @@ jobs:
2525
- uses: actions/upload-release-asset@v1
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28-
GIT_TAG_NAME: ${GITHUB_REF#refs/*/}
2928
with:
3029
upload_url: ${{ steps.create_release.outputs.upload_url }}
3130
asset_path: ./dist.tar.gz
32-
asset_name: xsnippet-web-${GIT_TAG_NAME}.tar.gz
31+
asset_name: xsnippet-web-${{ env.GIT_TAG_NAME }}.tar.gz
3332
asset_content_type: application/gzip

.github/workflows/test.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: test
22

33
on:
44
- push
@@ -11,19 +11,17 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v2
14-
- run: |
15-
npm install
16-
npm run lint
14+
- run: npm install
15+
- run: npm run lint
1716

1817
test:
1918
runs-on: ubuntu-latest
2019

2120
steps:
2221
- uses: actions/checkout@v2
2322
- uses: actions/setup-node@v2
24-
- run: |
25-
npm install
26-
npm run test
23+
- run: npm install
24+
- run: npm run test
2725

2826
build:
2927
needs: [lint, test]
@@ -32,6 +30,5 @@ jobs:
3230
steps:
3331
- uses: actions/checkout@v2
3432
- uses: actions/setup-node@v2
35-
- run: |
36-
npm install
37-
npm run build
33+
- run: npm install
34+
- run: npm run build

0 commit comments

Comments
 (0)