Simplify async opening code #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run releasing action (snapshot or release) | |
on: | |
push: | |
branches: | |
- master | |
- release/* | |
tags-ignore: | |
- "*-snapshot" | |
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() }} |