1
+ name : Close release
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ release_type :
7
+ description : ' Next version type'
8
+ required : true
9
+ type : choice
10
+ default : ' patch'
11
+ options :
12
+ - patch
13
+ - minor
14
+ - major
15
+
16
+ concurrency :
17
+ group : release
18
+ cancel-in-progress : false
19
+
20
+ jobs :
21
+ release :
22
+ name : Close release
23
+ runs-on : self-hosted-hoprnet-small
24
+
25
+ steps :
26
+ - name : Checkout repository
27
+ uses : actions/checkout@v4
28
+
29
+ - name : Setup Node.js
30
+ uses : hoprnet/hopr-workflows/actions/setup-node-js@master
31
+ with :
32
+ node-version : 20
33
+
34
+ - name : Setup GCP
35
+ id : gcp
36
+ uses : hoprnet/hopr-workflows/actions/setup-gcp@master
37
+ with :
38
+ google-credentials : ${{ secrets.GOOGLE_HOPRASSOCIATION_CREDENTIALS_REGISTRY }}
39
+ login-artifact-registry : ' true'
40
+
41
+ - name : Set up Docker Buildx
42
+ uses : docker/setup-buildx-action@v3
43
+ with :
44
+ driver : kubernetes
45
+
46
+ - name : Building
47
+ run : yarn build
48
+
49
+ - name : Linting
50
+ run : yarn lint:ci
51
+
52
+ - name : Formatting
53
+ run : yarn format:ci
54
+
55
+ - name : Testing
56
+ run : yarn test
57
+
58
+ - name : Setup environment variables
59
+ id : environment
60
+ run : |
61
+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
62
+ echo "release_version=${PACKAGE_VERSION}" >> $GITHUB_OUTPUT
63
+
64
+ - name : Create Release
65
+ uses : softprops/action-gh-release@v2
66
+ with :
67
+ body_path : changelog.md
68
+ name : ' uhttp-latency-monitor - v${{ steps.environment.outputs.release_version }}'
69
+ tag_name : v${{ steps.environment.outputs.release_version }}
70
+
71
+
72
+ - name : Build and push docker image
73
+ uses : docker/build-push-action@v4
74
+ with :
75
+ push : true
76
+ tags : europe-west3-docker.pkg.dev/hoprassociation/docker-images/uhttp-latency-monitor:${{ steps.environment.outputs.release_version }}
77
+
78
+ - name : Bump Version
79
+ id : bump
80
+ run : |
81
+ npm version ${{ inputs.release_type }} --no-git-tag-version
82
+ BUMP_VERSION=$(node -p "require('./package.json').version")
83
+ echo "bump_version=${BUMP_VERSION}" >> $GITHUB_OUTPUT
84
+
85
+ - name : Create Pull Request
86
+ uses : peter-evans/create-pull-request@v6
87
+ with :
88
+ token : ${{ secrets.GH_RUNNER_TOKEN }}
89
+ commit-message : ' Bump to version ${{ steps.bump.outputs.bump_version }}'
90
+ base : main
91
+ title : ' Open release ${{ steps.bump.outputs.bump_version }}'
92
+ body : ' The scope of this PR is to bump the new release ${{ steps.bump.outputs.bump_version }}'
93
+ branch : bot/open-${{ inputs.release_type }}-${{ steps.bump.outputs.bump_version }}
94
+ delete-branch : true
95
+ assignees : ${{ github.actor }}
96
+ team-reviewers : ' @hoprnet/hopr-products-team'
97
+
98
+ - name : Notify new release
99
+ uses : zulip/github-actions-zulip/send-message@v1
100
+ with :
101
+ api-key : ${{ secrets.ZULIP_API_KEY }}
102
+ email : ${{ secrets.ZULIP_EMAIL }}
103
+ organization-url : ' https://hopr.zulipchat.com'
104
+ type : ' stream'
105
+ to : ' Releases'
106
+ topic : ' main'
107
+ content : |
108
+ I'm thrilled to inform the new **uhttp-latency-monitor** version **${{ steps.environment.outputs.current_version }}** has been released.
0 commit comments