This repository has been archived by the owner on Jun 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
80 lines (67 loc) · 2.47 KB
/
maven-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
# This release process looks for tags and produces releases.
name: Release
on:
push:
tags:
- 'snmpman-parent-[0-9]+*'
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
md5sum: ${{ steps.md5sum.outputs.md5sum }}
sha256sum: ${{ steps.sha256sum.outputs.sha256sum }}
env:
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 21
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Extract current maven version
run: echo "::set-output name=version::$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout)"
id: version
shell: bash
- name: Calculate MD5
run: echo "::set-output name=md5sum::$(md5sum -b snmpman-cli/target/snmpman-cli-${{ steps.version.outputs.version }}-bin.tar.gz | cut -f1 -d" ")"
id: md5sum
shell: bash
- name: Calculate SHA256
run: echo "::set-output name=sha256sum::$(sha256sum -b snmpman-cli/target/snmpman-cli-${{ steps.version.outputs.version }}-bin.tar.gz | cut -f1 -d" ")"
id: sha256sum
shell: bash
- uses: actions/upload-artifact@v3
with:
name: snmpman-cli-${{ steps.version.outputs.version }}-bin.tar.gz
path: snmpman-cli/target/snmpman-cli-${{ steps.version.outputs.version }}-bin.tar.gz
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
body: |
# Release ${{ steps.version.outputs.version }}
## Changes
* 1
* 2
* 3
## Checksums
|Type|Message digest|
|----|--------------|
|MD5|`${{ steps.md5sum.outputs.md5sum }}`|
|SHA256|`${{ steps.sha256sum.outputs.sha256sum }}`|
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: snmpman-cli/target/snmpman-cli-${{ steps.version.outputs.version }}-bin.tar.gz
asset_name: snmpman-cli-${{ steps.version.outputs.version }}-bin.tar.gz
asset_content_type: application/tar+gzip