Skip to content

Commit

Permalink
Change main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fskhri authored Nov 8, 2024
1 parent f3845e0 commit e944bee
Showing 1 changed file with 11 additions and 50 deletions.
61 changes: 11 additions & 50 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
push:
branches:
- main

jobs:
build:
name: Build & Release
Expand All @@ -16,43 +16,18 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
repository: fskhri/jeketi-v2
token: ${{ secrets.TOKEN }}

# Cache Flutter SDK
- name: Cache Flutter SDK
uses: actions/cache@v3
- name: Set Up Java
uses: actions/setup-java@v3.12.0
with:
path: ~/.flutter-sdk
key: ${{ runner.os }}-flutter-sdk-${{ hashFiles('pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-flutter-sdk-
distribution: 'oracle'
java-version: '17'

- name: Set Up Flutter
if: steps.cache-flutter-sdk.outputs.cache-hit != 'true'
run: |
git clone https://github.com/flutter/flutter.git -b stable ~/.flutter-sdk
echo "$HOME/.flutter-sdk/bin" >> $GITHUB_PATH
# Cache Pub Dependencies
- name: Cache Flutter Packages
uses: actions/cache@v3
with:
path: |
~/.pub-cache
.packages
.flutter-plugins
.flutter-plugins-dependencies
key: ${{ runner.os }}-pub-cache-${{ hashFiles('pubspec.yaml') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Set Up Java
uses: actions/setup-java@v3
uses: subosito/flutter-action@v2
with:
distribution: 'adopt'
java-version: '17'
flutter-version: '3.22.2'
channel: 'stable'

- name: Install Dependencies
run: flutter pub get
Expand All @@ -73,30 +48,16 @@ jobs:
unique_tag="${base_version}-build-${{ github.run_number }}"
echo "UNIQUE_TAG=$unique_tag" >> $GITHUB_ENV
- name: Get Previous Tag
id: get_prev_tag
run: |
prev_tag=$(git describe --tags --abbrev=0)
echo "PREV_TAG=$prev_tag" >> $GITHUB_ENV
- name: Generate Changelog from Commits
id: generate_changelog
run: |
changelog=$(git log ${{ env.PREV_TAG }}..HEAD --pretty=format:"%h - %s (%an)")
echo "CHANGELOG=$changelog" >> $GITHUB_ENV
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/app-release.apk"
tag: v${{ env.UNIQUE_TAG }}
token: ${{ secrets.KOCAK }}
token: ${{ secrets.TOKEN }}
name: "Release v${{ env.UNIQUE_TAG }}"
body: |
## Changelog
${{ env.CHANGELOG }}
body: "Rilis otomatis dari GitHub Actions"

- name: Checkout jeketi-app Repository
- name: Push to jeketi-app Repository
uses: actions/checkout@v3
with:
repository: fskhri/jeketi-app
Expand Down

0 comments on commit e944bee

Please sign in to comment.