forked from artipie/artipie
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (92 loc) · 3.48 KB
/
docker-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
83
84
85
86
87
88
89
90
91
92
93
name: Release Docker images
on:
push:
tags:
- "v*"
jobs:
docker-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: 21
distribution: adopt
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-jdk-21-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-jdk-21-maven-
runs-on: ubuntu-latest
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- run: mvn versions:set -DnewVersion=${{ env.RELEASE_VERSION }}
- run: mvn install -DskipTests
- run: mvn -B deploy -Pdocker-build -Ddocker.image.name=${{ secrets.DOCKERHUB_REPO }} -DskipTests
working-directory: artipie-main
- run: mvn versions:set -DnewVersion=latest
- run: mvn install -DskipTests
- run: mvn -B deploy -Pdocker-build -Ddocker.image.name=${{ secrets.DOCKERHUB_REPO }} -DskipTests
working-directory: artipie-main
- run: mvn package -Pjar-build -DskipTests
working-directory: artipie-main
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artipie-main/target/artipie-main-latest-jar-with-dependencies.jar
asset_name: artipie-${{ env.RELEASE_VERSION }}-jar-with-dependencies.jar
asset_content_type: application/jar
working-directory: artipie-main
# run-benchmarks:
# runs-on: ubuntu-latest
# needs: docker-publish
# steps:
# - name: Check out the code
# uses: actions/checkout@v2
# with:
# ref: gh-pages
# - name: Set env
# env:
# ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
# run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF:10}
# - name: Run benchmarks
# id: run_benchmarks
# uses: artipie/benchmarks@master
# with:
# aws-access-key: '${{ secrets.PERF_AWS_ACCESS_KEY }}'
# aws-secret-key: '${{ secrets.PERF_AWS_SECRET_KEY }}'
# version: '${{ env.RELEASE_VERSION }}'
# - name: Commit benchmark results
# run: |
# export REPORT=${{ steps.run_benchmarks.outputs.report }}
# export VERSION=${{ env.RELEASE_VERSION }}
# mkdir -p benchmarks/$VERSION
# mv $REPORT benchmarks/$VERSION/
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git add benchmarks/$VERSION/$REPORT
# git commit -m "Add benchmark results for version=$VERSION"
# - name: Push benchmark results
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: 'gh-pages'