-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (48 loc) · 1.46 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Release
on:
workflow_dispatch:
jobs:
main:
name: tag
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Yarn Install
run: |
yarn install
- name: Yarn Build
run: yarn build
- name: Dist
run: zip -r dist dist/
- name: Get current date
run: |
VERSION=$(expr $(date +'%y') - 20)$(date +'.%m.%d.%H%M')
echo "TAG_NAME=$VERSION" >> $GITHUB_ENV
echo "RELEASE_NAME=$VERSION" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: ${{ env.RELEASE_NAME }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip
- name: Update Package
uses: fjogeleit/http-request-action@master
with:
url: "https://dashboard.workerb.app/_a/package_tag"
method: "POST"
data: '{ "tag": "${{ env.TAG_NAME }}", "token": "${{ secrets.UPDATE_TOKEN }}" }'