-
Notifications
You must be signed in to change notification settings - Fork 26
89 lines (76 loc) · 2.72 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
name: "release"
on:
workflow_dispatch:
inputs:
release-version:
description: 'Release version'
required: true
development-version:
description: 'Development version'
required: true
default: '0-SNAPSHOT'
env:
IDRIS2_TESTS_CG: jvm
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PREVIOUS_VERSION: 0.6.0.6
jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_PAT }}
- name: Set up JDK 8 to prepare release
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: 'maven'
server-id: github
server-username: mmhelloworld
server-password: ${{ secrets.GH_PAT }}
- name: Set IDRIS2_PREFIX
run: echo IDRIS2_PREFIX="$HOME/bin/idris2-$PREVIOUS_VERSION/env" >> "$GITHUB_ENV"
- name: Set PREFIX
run: echo PREFIX="$IDRIS2_PREFIX" >> "$GITHUB_ENV"
- name: Download previous version
run: |
mvn dependency:copy "-Dartifact=io.github.mmhelloworld:idris-jvm-compiler:$PREVIOUS_VERSION:zip" -DoutputDirectory=. -U
unzip idris-jvm-compiler-*.zip -d "$HOME/bin"
echo "::add-path::$HOME/bin/idris2-$PREVIOUS_VERSION/exec"
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Prepare release
run: mvn -B release:prepare -DreleaseVersion=${{ github.event.inputs.release-version }} -DdevelopmentVersion=${{ github.event.inputs.development-version }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
- name: Set up JDK 8 to perform release
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish to Maven Central
run: mvn -B release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Publish to Github
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: latest
prerelease: false
title: "Release ${{ github.event.inputs.release-version }}"
files: |
idris-jvm-compiler/target/idris2-*.zip