-
Notifications
You must be signed in to change notification settings - Fork 16
82 lines (66 loc) · 2.48 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
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
name: Release PASS-UI
on:
workflow_dispatch:
inputs:
releaseversion:
required: true
description: Version to release (e.g. 0.4.0)
nextversion:
required: true
description: Next development version (e.g. 0.5.0-SNAPSHOT)
jobs:
release:
if: github.repository == 'eclipse-pass/pass-ui'
runs-on: ubuntu-latest
env:
ENV_FILE: https://raw.githubusercontent.com/eclipse-pass/pass-docker/main/.env
DOCKER_IMAGE_NAME: ghcr.io/eclipse-pass/pass-ui
steps:
- uses: actions/checkout@v3
- name: Config git user
run: |
git config user.name ${{ github.actor }}
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Setup Node & Yarn
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Update project version
run: |
yarn install --frozen-lockfile
yarn version --new-version ${{ inputs.releaseversion }}
- name: Tag release
run: git tag ${{ inputs.releaseversion }}
- name: Build pass-ui
uses: ./.github/actions/build-pass-ui
with:
is-prod: true
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Retag and push
run: |
docker tag $DOCKER_IMAGE_NAME:latest $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }}
docker push $DOCKER_IMAGE_NAME:latest
docker push $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }}
- name: Update project version
run: yarn version --new-version ${{ inputs.nextversion }}
- name: Build next dev version
uses: ./.github/actions/build-pass-ui
with:
is-prod: false
# Commits made to branch specified in workflow_dispatch, push that branch if possible
- name: Push release commits to GH
if: github.ref_type == 'branch' && github.ref_protected == false
run: git push origin ${{ github.ref_name }}
# Push the release tag we made above
- name: Push release tag to GH
run: git push origin ${{ inputs.releaseversion }}
- name: Push next dev version image
run: |
docker tag $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} $DOCKER_IMAGE_NAME:${{ inputs.nextversion }}
docker push $DOCKER_IMAGE_NAME:${{ inputs.nextversion }}