-
-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (76 loc) · 2.77 KB
/
prerelease.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
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
88
89
90
name: Prerelease
on:
workflow_run:
workflows: ['Test']
branches: ['main', 'next']
types:
- completed
jobs:
main:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: '${{ secrets.TOLGEE_MACHINE_PAT }}'
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '20.x'
- name: Set git globals
run: |
git config --local user.email "machine@tolgee.io"
git config --local user.name "Tolgee Machine"
- name: Npm ci
run: npm ci
- name: Run get new version
run: npm run release-dry
- name: Set version property
id: version
run: echo ::set-output name=VERSION::$(test -e .VERSION && echo v$(cat .VERSION))
- name: Upgrade version in manifest.json
run: sh upgrade_manifest.sh $(cat .VERSION)
- name: Build (build & test)
run: export NODE_ENV=production && npm run build
- name: Set git globals
run: |
git config --local user.email "machine@tolgee.io"
git config --local user.name "Tolgee Machine"
- name: Run npm release
if: ${{ steps.version.outputs.VERSION != '' }}
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.TOLGEE_MACHINE_PAT }}
- name: Create Release
if: ${{ steps.version.outputs.VERSION != '' }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.TOLGEE_MACHINE_PAT }}
with:
tag_name: ${{ steps.version.outputs.VERSION }}
release_name: Release ${{ steps.version.outputs.VERSION }}
draft: false
prerelease: true
- name: Upload Release Asset Chrome
if: ${{ steps.version.outputs.VERSION != '' }}
id: upload-release-chrome-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOLGEE_MACHINE_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist-zip/chrome.zip
asset_name: Tolgee-chrome-${{ steps.version.outputs.VERSION }}.zip
asset_content_type: application/zip
- name: Upload Release Asset Firefox
if: ${{ steps.version.outputs.VERSION != '' }}
id: upload-release-firefox-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TOLGEE_MACHINE_PAT }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist-zip/firefox.zip
asset_name: Tolgee-firefox-${{ steps.version.outputs.VERSION }}.zip
asset_content_type: application/zip