Skip to content

Commit 21f6bfe

Browse files
committed
doc(prod): add github actions release
1 parent bd953be commit 21f6bfe

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

docs/intro/production-workflow.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ When publishing on the [Chrome Web Store](https://chrome.google.com/webstore) (o
5050

5151
## Automatic build and release with Travis
5252

53-
If you are using [Travis](https://travis-ci.com/), you can setup [GitHub Releases upload](https://docs.travis-ci.com/user/deployment/releases/) in order to automatically build a zip of your extension and attach it to your GitHub releases ([example](https://github.com/Kocal-Web-Extensions/Solary/releases/tag/v1.9.0)):
53+
If you are using [Travis](https://travis-ci.com/), you can setup [GitHub Releases upload](https://docs.travis-ci.com/user/deployment/releases/) in order to automatically build a zip of your extension and attach it to your GitHub releases ([example](https://github.com/Kocal/Solary/releases/tag/v1.9.0)):
5454

5555
```yaml
5656
script:
@@ -73,3 +73,52 @@ deploy:
7373
```
7474
7575
This is really useful if you don't want to manually run commands from [Building for production](https://vue-web-extension.netlify.app/intro/production-workflow#building-for-production).
76+
77+
## Automatic build and release with GitHub Actions
78+
79+
If you are using [GitHub Actions](https://github.com/features/actions), you can easily automatically build a zip of your extension and create a new GitHub release, each time a new tag is pushed.
80+
81+
```yml
82+
on:
83+
push:
84+
tags:
85+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
86+
87+
name: Release
88+
89+
jobs:
90+
build:
91+
name: Create Release
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v2
95+
- run: |
96+
git fetch --prune --unshallow
97+
98+
- name: Install Node.js
99+
uses: actions/setup-node@v1
100+
with:
101+
node-version: 12.x
102+
103+
- run: yarn install --frozen-lockfile
104+
105+
- run: yarn build
106+
107+
- run: yarn build-zip
108+
109+
- name: Create Release
110+
id: create_release
111+
uses: actions/create-release@v1
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
with:
115+
tag_name: ${{ github.ref }}
116+
release_name: Release ${{ github.ref }}
117+
118+
- name: Upload Assets to Release with a wildcard
119+
uses: csexton/release-asset-action@v2
120+
with:
121+
pattern: "dist-zip/*.zip"
122+
github-token: ${{ secrets.GITHUB_TOKEN }}
123+
release-url: ${{ steps.create_release.outputs.upload_url }}
124+
```

0 commit comments

Comments
 (0)