diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml new file mode 100644 index 0000000..0e36e96 --- /dev/null +++ b/.github/workflows/pull_requests.yml @@ -0,0 +1,39 @@ +name: PR build +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: 🏗 Setup repo + uses: actions/checkout@v3 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: "temurin" + + - name: 🏗 Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: yarn + + - name: 🏗 Setup EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + + - name: 📦 Install dependencies + run: yarn install + + - name: 🚀 Build app + run: eas build --non-interactive --platform android --local --profile production_apk --output=./app-release.apk + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: alby-go-android.apk + path: ./app-release.apk diff --git a/.github/workflows/main.yml b/.github/workflows/release.yml similarity index 58% rename from .github/workflows/main.yml rename to .github/workflows/release.yml index 5dd8518..0e5e217 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,13 @@ -on: [pull_request] +name: Release tag + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + jobs: - build: + build_android: + needs: [draft_release] runs-on: ubuntu-latest steps: - name: 🏗 Setup repo @@ -36,6 +43,17 @@ jobs: name: alby-go-android.apk path: ./app-release.apk + # APK + - name: Upload APK to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.draft_release.outputs.upload_url }} + asset_path: ./app-release.apk + asset_name: alby-go-${{ github.ref_name }}-android.apk + asset_content_type: application/vnd.android.package-archive + # - name: Create Release # id: create_release # uses: actions/create-release@v1 @@ -56,4 +74,34 @@ jobs: # upload_url: ${{ steps.create_release.outputs.upload_url }} # asset_path: ./app-release.apk # asset_name: alby-go-${{ github.ref_name }}-android.apk -# asset_content_type: application/vnd.android.package-archive \ No newline at end of file +# asset_content_type: application/vnd.android.package-archive + + draft_release: + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + id: ${{ steps.create_release.outputs.id }} + steps: + # Create Release + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: true + # prerelease: true + +# publish-release: +# needs: [release, build_android] +# runs-on: ubuntu-latest +# +# steps: +# - uses: eregon/publish-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# release_id: ${{ needs.release.outputs.id }} +#