Skip to content

Commit

Permalink
fixing GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-enko committed Mar 6, 2024
1 parent 7a9f279 commit 3b62e16
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 37 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ on:
push:
branches: [ main ]

release:
types: [ published ]


concurrency:
group: "Main: ${{ github.workflow }} @ ${{ inputs.checkout-ref }} ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: false
cancel-in-progress: true


permissions:
Expand All @@ -33,36 +30,3 @@ jobs:
contents: read
with:
checkout-ref: ${{ inputs.checkout-ref }}


build-datalyzer-zip:
needs: tests
uses: ./.github/workflows/run_gradle_task.yml
# only run if a release is created
if: github.event.release.name
permissions:
checks: write
contents: read
with:
runs-on: ubuntu-latest
gradle-task: distZip
checkout-ref: ${{ inputs.checkout-ref }}


publish-github-release:
needs: build-datalyzer-zip
runs-on: ubuntu-latest
steps:

- name: Download datalyzer.zip
uses: actions/download-artifact@v4
with:
name: "datalyzer.zip"

- name: Upload datalyzer.zip
shell: bash
run: |
gh release upload ${{ github.event.release.tag_name }} datalyzer.zip
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
GH_REPO: ${{ github.event.repository.name }}
65 changes: 65 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Main

on:
workflow_dispatch:
inputs:
checkout-ref:
description: "The branch, tag or SHA to checkout. See actions/checkout 'ref'."
required: false
type: string

release:
types: [ published ]


concurrency:
group: "Releases: ${{ github.workflow }} @ ${{ inputs.checkout-ref }} ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: false


permissions:
contents: write


jobs:

# tests:
# uses: ./.github/workflows/run_tests.yml
# permissions:
# checks: write
# contents: read
# with:
# checkout-ref: ${{ inputs.checkout-ref }}


build-datalyzer-zip:
# needs: tests
uses: ./.github/workflows/run_gradle_task.yml
# only run if a release is created
if: github.event.release.name
permissions:
checks: write
contents: read
with:
runs-on: ubuntu-latest
gradle-task: distZip
checkout-ref: ${{ inputs.checkout-ref }}


publish-github-release:
needs: build-datalyzer-zip
runs-on: ubuntu-latest
steps:

- name: Download datalyzer.zip
uses: actions/download-artifact@v4
with:
name: "datalyzer.zip"

- name: Upload datalyzer.zip
shell: bash
run: |
gh release upload ${{ github.event.release.tag_name }} datalyzer.zip
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
GH_REPO: ${{ github.event.repository.name }}

0 comments on commit 3b62e16

Please sign in to comment.