refactor: abstract build and release workflows into seperate workflows

This commit is contained in:
Adrian Castro
2024-02-04 19:18:24 +01:00
parent 4478366855
commit 0134c0ff92
2 changed files with 145 additions and 52 deletions

View File

@@ -1,33 +1,13 @@
name: build mobile app
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: write
jobs:
bump-version:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Automated Version Bump
uses: phips28/gh-action-bump-version@v10.1.1
with:
skip-tag: 'true'
commit-message: 'chore: bump mobile version to {{version}} [skip ci]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build-android:
runs-on: ubuntu-latest
@@ -112,33 +92,3 @@ jobs:
with:
name: ipa
path: ./apps/expo/ios/build/movie-web.ipa
release-app:
runs-on: ubuntu-latest
needs: [build-android, build-ios]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.package-version.outputs.current-version }}
files: |
movie-web.apk
movie-web.ipa
fail_on_unmatched_files: true
token: ${{ env.GITHUB_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}