Skip to content

Commit 4471bd3

Browse files
fix:tag issue fix
1 parent 6625d54 commit 4471bd3

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

.github/workflows/android-build.yml

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,67 @@ permissions:
1010

1111
jobs:
1212
build:
13-
name: Build APK
13+
name: Build APK
1414
runs-on: ubuntu-latest
1515

1616
steps:
1717
- name: Checkout Repository
1818
uses: actions/checkout@v3
19-
19+
2020
- name: Set up JDK
2121
uses: actions/setup-java@v2
2222
with:
23-
java-version: "18" # Specify the desired Java version
24-
distribution: "adopt" # Choose the JDK distribution
23+
java-version: "18"
24+
distribution: "adopt"
2525

2626
- name: Set up Node.js
2727
uses: actions/setup-node@v3
2828
with:
29-
node-version: '21' # Specify the Node.js version needed for your project
29+
node-version: '21'
3030

3131
- name: Install Dependencies
3232
run: |
33-
npm install -g corepack # Install global npm package (if needed)
34-
yarn install # Install project dependencies
33+
npm install -g corepack
34+
yarn install
3535
3636
- name: Build Release APK
3737
run: |
3838
cd android
39-
./gradlew assembleRelease # Execute Gradle task to build release APK
40-
41-
- name: Upload Release APK
42-
uses: actions/upload-artifact@v2
43-
with:
44-
name: app-release
45-
path: ./android/app/build/outputs/apk/release/app-release.apk # Path to the generated release APK
39+
./gradlew assembleRelease
4640
47-
create_release:
48-
name: Create Release
49-
needs: build
50-
runs-on: ubuntu-latest
51-
steps:
52-
- name: Checkout code
53-
uses: actions/checkout@v2
5441
- name: Set tag name
5542
id: set_tag_name
5643
run: |
5744
TAG_NAME="v$(date +'%Y%m%d')-${GITHUB_SHA::8}"
5845
echo "::set-output name=tag_name::$TAG_NAME"
46+
47+
- name: Upload Release APK
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: app-release
51+
path: ./android/app/build/outputs/apk/release/app-release.apk
52+
5953
- name: Create Release
6054
id: create_release
6155
uses: actions/create-release@v1
6256
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6458
with:
6559
tag_name: ${{ steps.set_tag_name.outputs.tag_name }}
6660
release_name: Release ${{ github.ref }}
6761
draft: false
6862
prerelease: false
63+
6964
- name: Upload APK to Release
70-
id: upload-release-asset
65+
id: upload-release-asset
7166
uses: actions/upload-release-asset@v1
7267
env:
7368
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7469
with:
75-
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
70+
upload_url: ${{ steps.create_release.outputs.upload_url }}
7671
asset_path: ./android/app/build/outputs/apk/release/app-release.apk
7772
asset_name: react-native-template.apk
7873
asset_content_type: application/zip
74+
75+
7976

0 commit comments

Comments
 (0)