forked from logstash-plugins/logstash-input-http
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (48 loc) · 1.81 KB
/
upload_release.yaml
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
name: Upload Release
on:
release:
types: published
jobs:
upload:
name: Upload
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache Local Maven Repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Setup GitHub Packages
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'adopt'
- name: Build jar
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build rpm
run: cd rpm/ && mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Attach jar and rpm to release
uses: softprops/action-gh-release@v1
with:
files: |
rpm/target/rpm/com.teragrep-lsh_01/RPMS/noarch/com.teragrep-lsh_01-*.rpm
target/lsh_01-jar-with-dependencies.jar
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase repository name
run: echo "REPO_LC=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: 'Build Image'
run: |
docker buildx build --output type=docker --tag ghcr.io/${{ env.REPO_LC }}:${{ github.event.release.tag_name }} --tag ghcr.io/${{ env.REPO_LC }}:latest .
docker push ghcr.io/${{ env.REPO_LC }} --all-tags