release #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
workflow_dispatch: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
environment: | |
name: semver | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Update Pubspec Version | |
run: | | |
NEW_VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//') | |
echo "New version: $NEW_VERSION" | |
sed -i "s/^version: .*/version: $NEW_VERSION/" pubspec.yaml | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add pubspec.yaml | |
git commit -m "ci: update pubspec version to $NEW_VERSION" | |
git push https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/Jiseeeh/u-do-note.git HEAD:main | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'oracle' | |
java-version: '17' | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.24.4' | |
- name: Install dependencies | |
run: | | |
flutter pub get | |
- name: Setup env | |
run: | | |
echo "OPENAI_KEY=${{ secrets.OPENAI_KEY }}" >> .env | |
echo "FEEDBACK_URL=${{ secrets.FEEDBACK_URL }}" >> .env | |
- name: Build runner | |
run : | | |
dart run build_runner build --delete-conflicting-outputs | |
- name: Decode Keystore | |
run: | | |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/keystore.jks | |
- name: Create key.properties | |
run: | | |
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties | |
echo "keyPassword=${{ secrets.KEYSTORE_PASSWORD }}" >> android/key.properties | |
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties | |
echo "storeFile=keystore.jks" >> android/key.properties | |
# fix test comment | |
- name: Build APK | |
run: flutter build apk --release | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Releases | |
path: | | |
build/app/outputs/flutter-apk/app-release.apk |