robosats/.github/workflows/release.yml

167 lines
6.0 KiB
YAML
Raw Normal View History

name: Release
on:
push:
tags:
- "v*.*.*"
permissions: write-all
jobs:
check-versions:
runs-on: ubuntu-latest
outputs:
semver: ${{ steps.validate.outputs.semver }}
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Validate versions match (tag, backend, frontend, Android)'
id: validate
shell: bash
run: |
semver=$(git describe --tags --abbrev=0)
IFS=-
read -ra semverArray <<< $semver
tagV=$(echo ${semverArray[0]} | sed 's/v//')
clientV=$(jq -r .version frontend/package.json)
2022-10-06 10:53:03 +00:00
androidV=$(grep -oP '(?<=versionName ").*?((?=\-)|$)' mobile/android/app/build.gradle)
coordinatorV=$(jq -r .major version.json).$(jq -r .minor version.json).$(jq -r .patch version.json)
printf "Client version: ${clientV}\nCoordinator version: ${coordinatorV}\nGit tag version: ${tagV}\n"
2022-10-06 10:53:03 +00:00
if [ "$coordinatorV" = "$clientV" ] && [ "$coordinatorV" = "$tagV" ] && [ "$coordinatorV" = "$androidV" ]; then
echo "Versions match!"
echo '::set-output name=semver::'$semver
else
echo "Versions do not match! You might have forgotten to update the version on a component."; exit $ERRCODE;
fi
2022-10-25 18:04:12 +00:00
# django-test:
# uses: RoboSats/robosats/.github/workflows/django-test.yml@main
# needs: check-versions
frontend-build:
2023-05-09 13:07:16 +00:00
uses: RoboSats/robosats/.github/workflows/frontend-build.yml@main
needs: check-versions
with:
semver: ${{ needs.check-versions.outputs.semver }}
2022-10-25 18:04:12 +00:00
coordinator-image:
2023-05-09 13:07:16 +00:00
uses: RoboSats/robosats/.github/workflows/coordinator-image.yml@main
needs: [frontend-build] # django-test,
secrets: inherit
2022-09-29 12:49:01 +00:00
with:
semver: ${{ needs.check-versions.outputs.semver }}
2022-10-25 18:04:12 +00:00
client-image:
2023-05-09 13:07:16 +00:00
uses: RoboSats/robosats/.github/workflows/client-image.yml@main
needs: frontend-build
secrets: inherit
2022-09-29 12:49:01 +00:00
with:
semver: ${{ needs.check-versions.outputs.semver }}
2022-10-25 18:04:12 +00:00
android-build:
2023-05-09 13:07:16 +00:00
uses: RoboSats/robosats/.github/workflows/android-build.yml@main
2022-09-29 12:49:01 +00:00
needs: [frontend-build, check-versions]
with:
semver: ${{ needs.check-versions.outputs.semver }}
2022-10-25 18:04:12 +00:00
release:
2022-09-29 12:49:01 +00:00
needs: [check-versions, coordinator-image, client-image, android-build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Release
id: create-release
uses: softprops/action-gh-release@v1
2023-05-26 13:02:57 +00:00
with:
body_path: release_notes.md
generate_release_notes: true
# Upload app-universal-release APK artifact asset
- name: 'Download universal APK Artifact'
2022-09-29 12:49:01 +00:00
uses: actions/download-artifact@v3
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-universal.apk
path: .
- name: 'Upload universal APK Asset'
2023-04-10 17:38:42 +00:00
id: upload-universal-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-universal-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-universal.apk
asset_content_type: application/apk
# Upload app-arm64-v8a-release APK artifact asset
- name: 'Download arm64-v8a APK Artifact'
uses: actions/download-artifact@v3
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-arm64-v8a.apk
path: .
- name: 'Upload arm64-v8a APK Asset'
2023-04-10 17:38:42 +00:00
id: upload-arm64-v8a-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-arm64-v8a-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-arm64-v8a.apk
asset_content_type: application/apk
# Upload app-armeabi-v7a-release APK artifact asset
- name: 'Download armeabi-v7a APK Artifact'
uses: actions/download-artifact@v3
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-armeabi-v7a.apk
path: .
- name: 'Upload armeabi-v7a APK Asset'
2023-04-10 17:38:42 +00:00
id: upload-armeabi-v7a-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-armeabi-v7a-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-armeabi-v7a.apk
asset_content_type: application/apk
# Upload app-x86_64-release APK artifact asset
- name: 'Download x86_64 APK Artifact'
uses: actions/download-artifact@v3
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-x86_64.apk
path: .
- name: 'Upload x86_64 APK Asset'
2023-04-10 17:38:42 +00:00
id: upload-x86_64-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-x86_64-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-x86_64.apk
asset_content_type: application/apk
# Upload app-x86-release APK artifact asset
- name: 'Download x86 APK Artifact'
uses: actions/download-artifact@v3
with:
name: robosats-${{ needs.check-versions.outputs.semver }}-x86.apk
path: .
- name: 'Upload x86 APK Asset'
2023-04-10 17:38:42 +00:00
id: upload-x86-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: app-x86-release.apk
asset_name: robosats-${{ needs.check-versions.outputs.semver }}-x86.apk
asset_content_type: application/apk