Skip to content

Release

Release #38

Workflow file for this run

name: Release
on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
inputs:
version:
description: "Version Number (x.y.z)"
type: string
release:
description: "Create Release?"
required: false
default: false
type: boolean
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version || steps.custom.outputs.version || steps.tag.outputs.version }}
steps:
- name: Output Version
id: version
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version == '' ) }}
run: echo "version=$(date +'%Y%m%d-%H%M')" >> $GITHUB_OUTPUT
- name: Output Custom Version
id: custom
if: ${{ github.event_name == 'workflow_dispatch' && inputs.version != '' }}
run: echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
- name: Output Tag
id: tag
if: ${{ github.event_name == 'push' }}
run: echo "version=$(echo ${GITHUB_REF#refs/*/} | sed -e 's/v//')" >> $GITHUB_OUTPUT
linux:
needs: version
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
uses: ./.github/workflows/release-linux.yml
with:
version: ${{ needs.version.outputs.version }}
platform: ${{ matrix.os }}
windows:
needs: version
strategy:
matrix:
os: [windows-2022, windows-2019]
uses: ./.github/workflows/release-windows.yml
with:
version: ${{ needs.version.outputs.version }}
platform: ${{ matrix.os }}
mac:
needs: version
strategy:
matrix:
os: [macos-12, macos-11]
uses: ./.github/workflows/release-mac.yml
with:
version: ${{ needs.version.outputs.version }}
platform: ${{ matrix.os }}
release:
needs: [version, linux, windows, mac]
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }} # Set job-level output
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.release == 'true')
steps:
- name: Create Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.version.outputs.version }}
release_name: Release ${{ needs.version.outputs.version }}
draft: false
prerelease: false
release-upload-linux:
needs: [version, release]
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
runs-on: ubuntu-latest
steps:
- name: Download .deb Artifact
uses: actions/download-artifact@v2
with:
name: AsTeRICS ${{ needs.version.outputs.version }} (${{ matrix.os }})
- name: Upload Release Asset (Linux)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./asterics-are-${{ needs.version.outputs.version }}.deb
asset_name: asterics-are-${{ needs.version.outputs.version }}-${{ matrix.os }}.deb
asset_content_type: application/vnd.debian.binary-package
release-upload-windows:
needs: [version, release]
strategy:
matrix:
os: [windows-2022, windows-2019]
runs-on: ubuntu-latest
steps:
- name: Download .exe Artifact
uses: actions/download-artifact@v2
with:
name: AsTeRICS ${{ needs.version.outputs.version }} (${{ matrix.os }})
- name: Upload Release Asset (Windows)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./Setup_AsTeRICS_${{ needs.version.outputs.version }}.exe
asset_name: Setup_AsTeRICS_${{ needs.version.outputs.version }}_${{ matrix.os }}.exe
asset_content_type: application/x-msdownload
release-upload-mac:
needs: [version, release]
strategy:
matrix:
os: [macos-12, macos-11]
runs-on: ubuntu-latest
steps:
- name: Download .dmg Artifact
uses: actions/download-artifact@v2
with:
name: AsTeRICS ${{ needs.version.outputs.version }} (${{ matrix.os }})
- name: Upload Release Asset (macOS)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./asterics-are-javaembedded-${{ needs.version.outputs.version }}.dmg
asset_name: asterics-are-javaembedded-${{ needs.version.outputs.version }}-${{ matrix.os }}.dmg
asset_content_type: application/x-apple-diskimage