Release & Deploy HollyBike v1.0.1 by @Loic-Vanden-Bossche #140
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: Release & Deploy | |
run-name: Release & Deploy HollyBike v${{ inputs.version }}${{ fromJSON('[" (production only)", ""]')[inputs.create-executables] }} by @${{ github.actor }} | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version of the release' | |
required: true | |
create-executables: | |
type: boolean | |
description: 'Create executables' | |
default: false | |
env: | |
CI: true | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
build-frontend-backend: | |
name: Frontend & Backend | |
uses: ./.github/workflows/backend.yml | |
with: | |
version: ${{ github.event.inputs.version }} | |
create-executables: ${{ github.event.inputs.create-executables == 'true' }} | |
secrets: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
MAPBOX_PUBLIC_ACCESS_TOKEN: ${{ secrets.MAPBOX_PUBLIC_ACCESS_TOKEN }} | |
build-app: | |
name: App | |
uses: ./.github/workflows/app.yml | |
with: | |
version: ${{ github.event.inputs.version }} | |
create-executables: ${{ github.event.inputs.create-executables == 'true' }} | |
secrets: | |
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} | |
ANDROID_KEY_PROPERTIES: ${{ secrets.ANDROID_KEY_PROPERTIES }} | |
PRODUCTION_CREDENTIAL_FILE: ${{ secrets.PRODUCTION_CREDENTIAL_FILE }} | |
MAPBOX_DOWNLOADS_TOKEN: ${{ secrets.MAPBOX_DOWNLOADS_TOKEN }} | |
MAPBOX_PUBLIC_ACCESS_TOKEN: ${{ secrets.MAPBOX_PUBLIC_ACCESS_TOKEN }} | |
create-release: | |
name: Create Release | |
if: | | |
always() && | |
needs.build-app.result == 'success' && | |
needs.build-frontend-backend.result == 'success' | |
needs: | |
- build-app | |
- build-frontend-backend | |
runs-on: ubuntu-latest | |
env: | |
version: ${{ github.event.inputs.version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get app artifact | |
if: inputs.create-executables | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
pattern: HollyBike-${{ env.version }}-* | |
path: . | |
- name: Create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
EXECUTABLES: 'hollybike-Android-${{ env.version }}.apk hollybike-Windows-${{ env.version }}-x86_64.exe hollybike-Linux-${{ env.version }}-x86_64' | |
run: | | |
gh release create "$version" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${GITHUB_REPOSITORY#*/}-${version#v}${{ fromJSON('[" (production only)", ""]')[inputs.create-executables] }}" \ | |
--generate-notes \ | |
${{ fromJSON('["", "$EXECUTABLES"]')[inputs.create-executables] }} | |