forked from WaterdogPE/WaterdogPE
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 1.7 KB
/
release-workflow.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
name: Release Build
on:
workflow_dispatch:
push:
tags-ignore:
- '**'
branches:
- '**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set version to release
run: |
sed -i -e s/#build/"release"/g ./src/main/java/dev/waterdog/waterdogpe/VersionInfo.java
- name: Build
uses: ./.github/actions/build
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
perform_deploy: true
deploy_repository: "waterdog-releases"
deploy_username: ${{ secrets.DEPLOY_USERNAME }}
deploy_password: ${{ secrets.DEPLOY_PASSWORD }}
create_prerelease: false # Use custom release step
- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
target/Waterdog.jar
- name: Docker Login
uses: docker/login-action@v1
with:
registry: "ghcr.io"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: "ghcr.io/${{ github.repository }}"
tags: |
type=semver,pattern={{version}}
type=raw,value=release
- name: Docker build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}