This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (62 loc) · 2.38 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
name: Release PASS-auth
on:
workflow_dispatch:
inputs:
releaseversion:
required: true
description: Version to release (e.g. 0.3.0)
nextversion:
required: true
description: Next development version (e.g. 0.4.0-SNAPSHOT)
jobs:
release:
if: github.repository == 'eclipse-pass/pass-auth'
runs-on: ubuntu-latest
env:
DOCKER_IMAGE_NAME: ghcr.io/eclipse-pass/pass-auth
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 to release version
run: |
yarn install --frozen-lockfile
yarn version --new-version ${{ inputs.releaseversion }}
- name: Tag release
run: git tag ${{ inputs.releaseversion }}
- name: Build pass-auth
run: |
yarn install --frozen-lockfile
yarn run build
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push release version image
run: docker push $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }}
- name: Bump project version to next dev version
run: yarn version --new-version ${{ inputs.nextversion }}
# 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: Retag and push next dev image
run: |
docker tag $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} $DOCKER_IMAGE_NAME:${{ inputs.nextversion }}
docker push $DOCKER_IMAGE_NAME:${{ inputs.nextversion }}
- name: 'Retag and push :latest image'
run: |
docker tag $DOCKER_IMAGE_NAME:${{ inputs.releaseversion }} $DOCKER_IMAGE_NAME:latest
docker push $DOCKER_IMAGE_NAME:latest