-
-
Notifications
You must be signed in to change notification settings - Fork 632
50 lines (49 loc) · 1.55 KB
/
beta.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
name: Beta Release
on:
push:
branches:
- master
paths-ignore:
- .github/workflows/*
jobs:
pre-release:
name: "Beta Release"
environment: production
runs-on: "ubuntu-latest"
services:
mongodb:
image: mongo:3.2
ports:
- 27017:27017
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'
- name: Run tests
run: ./gradlew clean test --info
- name: Set short git hash
id: var
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build artifacts
run: ./gradlew -Penv=beta -Phash=${{ steps.var.outputs.sha_short }} clean assemble
- name: Release
if: github.repository == 'sdkman/sdkman-cli'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Beta release"
files: |
build/distributions/sdkman-cli-*.zip
- name: Update MongoDB
if: github.repository == 'sdkman/sdkman-cli'
env:
MONGO_URL: ${{ secrets.MONGO_URL }}
MONGO_USERNAME: ${{ secrets.MONGO_USERNAME }}
MONGO_PASSWORD: ${{ secrets.MONGO_PASSWORD }}
SHORT_HASH: ${{ steps.var.outputs.sha_short }}
run: bin/release-binary.sh "$MONGO_URL" "$MONGO_USERNAME" "$MONGO_PASSWORD" "$SHORT_HASH" "latest"