-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (93 loc) · 3.47 KB
/
releasing.yaml
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
name: Run releasing action (snapshot or release)
on:
push:
branches:
- master
- release/*
tags-ignore:
- "*-snapshot"
paths-ignore:
- 'docs/site/**'
env:
PYTHON_BINARY: python3
jobs:
build-snapshot:
runs-on: ubuntu-latest
container: ghcr.io/mlopatkin/andlogview-build-environment@sha256:de07d2f4cafea51cffe8fd09f7b5de4987a262ae829ca508468aaf5feafe668d
# Only build snapshots on master
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Build and publish snapshot
# gradle-build-action 2.9.0
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a
# Do not use Gradle Daemon because we only have a single invocation.
with:
arguments: |
-Porg.gradle.java.installations.fromEnv=JDK8,JDK17
-Porg.gradle.java.installations.auto-download=false
-Porg.gradle.java.installations.auto-detect=false
--no-daemon
--stacktrace
check bitbucketUpload
env:
BITBUCKET_PASSWORD: ${{ secrets.BITBUCKET_PASSWORD }}
BITBUCKET_USER: mlopatkin
- name: Publish artifacts
uses: ./.github/actions/publish-gradle-outputs
- name: Publish Github release
uses: marvinpinto/[email protected]
if: ${{ success() }}
with:
files: build/distributions/*
prerelease: true
automatic_release_tag: "latest-snapshot"
repo_token: ${{ secrets.GITHUB_TOKEN }}
build-release:
runs-on: ubuntu-latest
container: ghcr.io/mlopatkin/andlogview-build-environment@sha256:de07d2f4cafea51cffe8fd09f7b5de4987a262ae829ca508468aaf5feafe668d
# Only build releases out of tags
if: github.ref_type == 'tag' && !endsWith(github.ref, '-snapshot')
steps:
- uses: actions/checkout@v4
- name: Build and publish release
# gradle-build-action 2.9.0
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a
# Do not use Gradle Daemon because we only have a single invocation.
with:
arguments: |
-Porg.gradle.java.installations.fromEnv=JDK8,JDK17
-Porg.gradle.java.installations.auto-download=false
-Porg.gradle.java.installations.auto-detect=false
--no-daemon
--stacktrace
check bitbucketUpload
env:
BITBUCKET_PASSWORD: ${{ secrets.BITBUCKET_PASSWORD }}
BITBUCKET_USER: mlopatkin
LOGVIEW_SNAPSHOT_BUILD: false
- name: Publish artifacts
uses: ./.github/actions/publish-gradle-outputs
mirror-to-bitbucket:
runs-on: ubuntu-latest
# build-snapshot publishes a tag that we want to sync with bitbucket as well, so wait for it to complete
needs:
- build-snapshot
if: ${{ always() }}
steps:
- uses: actions/checkout@v4
- name: setup git for bitbucket
run: tools/bitbucket-mirror/setup-bitbucket.sh
shell: bash
env:
BITBUCKET_SSH_PRIVATE_KEY: ${{ secrets.BITBUCKET_SSH_KEY }}
BITBUCKET_HOST_FINGERPRINT: ${{ secrets.BITBUCKET_HOST_FINGERPRINT }}
- name: clone origin as mirror and push to bitbucket
run: tools/bitbucket-mirror/clone-and-push.sh
shell: bash
env:
MIRROR_REPO_PATH: ${{ runner.temp }}/origin
- name: cleanup config
run: tools/bitbucket-mirror/cleanup.sh
shell: bash
if: ${{ always() }}