-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (57 loc) · 2.01 KB
/
release-build.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
name: Release Build
on:
push:
branches:
- main
- develop
tags: '*'
jobs:
build:
name: Release Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Setup Node.js
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
# Ubuntu 16+ does not install libgconf-2-4 by default, so we need to install it ourselves (for Cypress)
run: |
sudo apt-get install libgconf-2-4
yarn --immutable
- name: Build
run: yarn build
- name: Determine tag name
run: |
if [ "${{ github.ref }}" = "refs/heads/main" ]
then
echo TAG_NAME=snapshot >> $GITHUB_ENV
elif [ "${{ github.ref }}" = "refs/heads/develop" ]
then
echo TAG_NAME=snapshot-develop >> $GITHUB_ENV
else
echo TAG_NAME=`basename ${{ github.ref }}` >> $GITHUB_ENV
fi
- name: Create tarball
run: |
mv build scigateway-$TAG_NAME
tar -czf scigateway-$TAG_NAME.tar.gz scigateway-$TAG_NAME
- name: Update snapshot tag
uses: richardsimko/update-tag@e173a8ef8f54ab526a91dad6139a25efed62424c # v1
with:
tag_name: ${{ env.TAG_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
- name: Create/update release
uses: johnwbyrd/update-release@1d5ec4791e40507e5eca3b4dbf90f0b27e7e4979 # v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ./scigateway-${{ env.TAG_NAME }}.tar.gz
release: Release ${{ env.TAG_NAME }}
tag: ${{ env.TAG_NAME }}
prerelease: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
draft: false