forked from InteraactionGroup/InterAACtionScene
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.71 KB
/
release.yml
File metadata and controls
87 lines (75 loc) · 2.71 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
on:
push:
branches:
- master
name: Release Scene
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@master
with:
node-version: '10.x'
- name: Install Dependencies
run: npm install
- name: Build Prod
run: npm run build --prod
- name: Zip & Tar gz Prod
run: |
cd ./dist/
zip -r InterAACtionScene.zip *
mv InterAACtionScene.zip ../
tar -czvf InterAACtionScene.tar.gz *
mv InterAACtionScene.tar.gz ../
cd ../
- name: Build prod Ligone
run: npm run ligone
- name: Zip prod Ligone
run: |
cd ./dist/
zip -r InterAACtionSceneLigone.zip *
mv InterAACtionSceneLigone.zip ../
- name: Get Env
run: |
echo "REPO_NAME=${{ github.repository }}" >> $GITHUB_ENV
echo "REPO_BASENAME=$(basename ${{ github.repository }})" >> $GITHUB_ENV
- name: New tag
id: new-tag
run: |
LATEST_RELEASE_INFO=$(curl -s https://api.github.com/repos/${{ env.REPO_NAME }}/releases/latest)
NEW_VERSION_LINK=$(echo "$LATEST_RELEASE_INFO" | grep "browser_download_url.*InterAACtionScene*" | cut -d: -f2,3 | tr -d \")
NEW_VERSION=$( echo "${NEW_VERSION_LINK}" | cut -d/ -f9)
NEW_VERSION_NO_EXT=$( echo ${NEW_VERSION} | cut -d. -f1)
NEW_VERSION_NAME=$(echo "$LATEST_RELEASE_INFO" | grep "name.*InterAACtionScene*" | cut -d: -f2,3 | tr -d \" | head -n 1 | tr -d \,)
GET_TAG=$(echo "$NEW_VERSION_NAME" | cut -d " " -f3)
TAG_1=$(echo "$GET_TAG" | cut -d. -f1)
TAG_2=$(echo "$GET_TAG" | cut -d. -f2)
TAG_3=$(echo "$GET_TAG" | cut -d. -f3)
NEW_TAG=$(echo "$(( $TAG_3 + 1 ))")
TAG="${TAG_1}.${TAG_2}.${NEW_TAG}"
echo ::set-output name=tag::$(echo $TAG)
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.new-tag.outputs.tag }}
release_name: ${{ env.REPO_BASENAME }} ${{ steps.new-tag.outputs.tag }}
draft: false
prerelease: false
- name: Upload Release
id: upload-assets
uses: csexton/release-asset-action@v2
with:
release-url: ${{ steps.create_release.outputs.upload_url }}
files: |
InterAACtionScene.tar.gz
InterAACtionScene.zip
InterAACtionSceneLigone.zip
github-token: ${{ secrets.GITHUB_TOKEN }}