Skip to content

Commit

Permalink
Rework release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetiroka committed Jun 4, 2024
1 parent e274ae9 commit 073995b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 26 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/cd-release-auto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release CD (automatic)
# Uploads the jar files and the manpage to any created release.
on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
release_linux:
name: Release - Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'semeru'
java-version: '21'
cache: 'maven'
- name: Compile project
run: mvn -B package -Pportable --file pom.xml
- name: Upload jars to release
uses: svenstaro/upload-release-action@v2
with:
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/*.jar
file_glob: true
- name: Upload manpage to release
uses: svenstaro/upload-release-action@v2
with:
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/debian-control-linter.1
file_glob: true
45 changes: 19 additions & 26 deletions .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
name: Release CD

# Compiles the native executable without needing a release. The executable has to be uploaded manually.
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
release_version:
description: The release version to build
required: true
type: string

permissions:
contents: write

jobs:
test_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run release tests
run: bash src/test/release_tests.java '{{ inputs.release_version }}'

release_linux:
name: Release - Linux
runs-on: ubuntu-latest
Expand All @@ -27,26 +37,9 @@ jobs:
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compile project
run: mvn -B package -Pnative,portable --file pom.xml
- name: Upload jars to release
uses: svenstaro/upload-release-action@v2
with:
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/*.jar
file_glob: true
- name: Upload manpage to release
uses: svenstaro/upload-release-action@v2
with:
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/debian-control-linter.1
file_glob: true
- name: Upload native executable to release
uses: svenstaro/upload-release-action@v2
run: mvn -B package -Pnative --file pom.xml
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/debian-control-linter
draft: true
file_glob: true
name: debian-control-linter
path: ./target/debian-control-linter

0 comments on commit 073995b

Please sign in to comment.