-
Notifications
You must be signed in to change notification settings - Fork 3
124 lines (122 loc) · 4.08 KB
/
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Release
on:
workflow_dispatch:
inputs:
release_version:
description: Release version
required: false
default: ''
jobs:
pre-release:
runs-on: ubuntu-latest
outputs:
release-tag: ${{ steps.latest-tag.outputs.tag }}
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Setup JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
- name: Configure local git
run: >-
git config user.name "${{ secrets.GIT_USERNAME }}" &&
git config user.email "${{ secrets.GIT_USER_EMAIL }}"
- name: Release the specified version
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
if: ${{ github.event.inputs.release_version != '' }}
run: sbt "preRelease ${{ github.event.inputs.release_version }}"
- name: Release new version
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
if: ${{ github.event.inputs.release_version == '' }}
run: sbt "preRelease next"
- name: Latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: latest-tag
- name: Github Release
id: gh_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.latest-tag.outputs.tag }}
body_path: CHANGELOG.md
files: |
target/scala-*/polystat.jar
# build-binaries:
# needs: pre-release
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: []
# include:
# - os: ubuntu-latest
# uploaded_filename: polystat-x86_64-pc-linux
# local_path: polystat
# - os: windows-latest
# uploaded_filename: polystat-x86_64-pc-win32.exe
# local_path: polystat.exe
# steps:
# - name: Check out repository code
# uses: actions/checkout@v2
# with:
# token: ${{ secrets.GIT_TOKEN }}
# - name: Configure local git
# run: >-
# git config user.name "${{ secrets.GIT_USERNAME }}" &&
# git config user.email "${{ secrets.GIT_USER_EMAIL }}"
# - run: git pull --no-rebase
# - uses: olafurpg/setup-scala@v13
# - name: Set up Visual Studio shell
# uses: egor-tensin/vs-shell@v2
# if: ${{ matrix.os == 'windows-latest' }}
# - name: build native image (windows)
# if: ${{ matrix.os == 'windows-latest' }}
# shell: cmd
# run: >-
# echo %PATH% &&
# sbt nativeImage &&
# copy target\native-image\polystat-cli.exe ${{ matrix.uploaded_filename }} &&
# tree
# - name: build native image (linux)
# if: ${{ matrix.os != 'windows-latest' }}
# shell: bash
# run: |
# echo $PATH
# sbt "nativeImageCopy ${{ matrix.uploaded_filename }}" nativeImageRun
# - name: Upload release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ needs.pre-release.outputs.release-tag }}
# files: ${{ matrix.uploaded_filename }}
post-release:
needs: pre-release
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Configure local git
run: |
git config user.name "${{ secrets.GIT_USERNAME }}"
git config user.email "${{ secrets.GIT_USER_EMAIL }}"
- name: setup JDK
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- run: git pull --no-rebase
- name: Run post-release steps
run: |
sbt postRelease