Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update github pipeline to release v11 build #924

Merged
merged 6 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 50 additions & 4 deletions .github/workflows/branch-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,58 @@ jobs:
name: Android Build

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4

- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- uses: actions/cache@v3
if: ${{ github.event_name != 'pull_request' && github.repository == 'fossasia/badgemagic-android' && github.ref == 'refs/heads/master' }}
with:
path: |
vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-

- name: Prepare Bundler
if: ${{ github.event_name != 'pull_request' && github.repository == 'fossasia/badgemagic-android' && github.ref == 'refs/heads/master' }}
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

- name: Pre Checks
run: |
bash scripts/check-screenshots.sh

- name: Prepare Build Keys
if: ${{ github.event_name != 'pull_request' && github.repository == 'fossasia/badgemagic-android' }}
env:
ENCRYPTED_F10B5E0E5262_IV: ${{ secrets.ENCRYPTED_F10B5E0E5262_IV }}
ENCRYPTED_F10B5E0E5262_KEY: ${{ secrets.ENCRYPTED_F10B5E0E5262_KEY }}
run: |
bash scripts/prep-key.sh

- name: Grant permission for gradlew
run: chmod +x gradlew

- name: Syntax Check
run: ./gradlew spotlessCheck

- name: Build with Gradle
run: ./gradlew build --no-daemon --stacktrace

- name: Build app bundle release
env:
STORE_PASS: ${{ secrets.STORE_PASS }}
ALIAS: ${{ secrets.ALIAS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
run: ./gradlew bundleRelease

- name: Upload APK Debug
Expand All @@ -50,7 +86,7 @@ jobs:

- name: Upload APK to apk branch
# Skip upload APK for pull requests
if: ${{ github.event_name != 'pull_request'}}
if: ${{ github.event_name != 'pull_request' && github.repository == 'fossasia/badgemagic-android' }}
run: |
git config --global user.name "${{ github.workflow }}"
git config --global user.email "gh-actions@${{ github.repository_owner }}"
Expand All @@ -67,8 +103,10 @@ jobs:

find ../android/build/outputs -type f \( -name '*.apk' -o -name '*.aab' \) -exec cp -v {} . \;

branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}

for file in android*; do
mv $file badge-magic-development-${file#*-}
mv $file badge-magic-$branch-${file#*-}
done

git checkout --orphan temporary
Expand All @@ -77,3 +115,11 @@ jobs:
git branch -D apk
git branch -m apk
git push --force origin apk

- name: Upload alpha version to playstore
if: ${{ github.event_name != 'pull_request' && github.repository == 'fossasia/badgemagic-android' && github.ref == 'refs/heads/master' }}
run: |
bundle exec fastlane uploadToPlaystore
if [[ $? -ne 0 ]]; then
exit 1
fi
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
This is an Open Source project and we would be happy to see contributors who report bugs and file feature requests submitting pull requests as well.
This project adheres to the Contributor Covenant code of conduct.
By participating, you are expected to uphold this code style.
Please report issues here [Issues - fossasia/badge-magic-android](https://github.com/fossasia/badge-magic-android/issues)
Please report issues here [Issues - fossasia/badgemagic-android](https://github.com/fossasia/badgemagic-android/issues)

### Branch Policy

#### Sending pull requests:

Go to the repository on github at https://github.com/fossasia/badge-magic-android .
Go to the repository on github at https://github.com/fossasia/badgemagic-android .

Click the “Fork” button at the top right.

Expand All @@ -20,19 +20,19 @@ Open a terminal/shell.

Type

`$ git clone https://github.com/username/badge-magic-android`
`$ git clone https://github.com/username/badgemagic-android`

where 'username' is your username.

You’ll now have a local copy of your version of the original FOSSASIA repository.

#### Change into that project directory (badge-magic-android):
#### Change into that project directory (badgemagic-android):

`$ cd badge-magic-android`
`$ cd badgemagic-android`

#### Add a connection to the original FOSSASIA repository.

`$ git remote add upstream https://github.com/fossasia/badge-magic-android`
`$ git remote add upstream https://github.com/fossasia/badgemagic-android`

#### To check this remote add set up:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Badge Magic
[![Join the chat at https://gitter.im/fossasia/badge-magic](https://badges.gitter.im/fossasia/badge-magic.svg)](https://gitter.im/fossasia/badge-magic?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
![Github](https://img.shields.io/github/license/fossasia/badge-magic-android?logo=github)
![Github](https://img.shields.io/github/license/fossasia/badgemagic-android?logo=github)

**Python Library to program via desktop https://github.com/fossasia/led-name-badge-ls32**

Expand All @@ -15,8 +15,8 @@ The Badge Magic Android app lets you create moving text and draw clipart for LED

## Download

* [Latest Release Build](https://github.com/fossasia/badge-magic-android/raw/apk/badge-magic-master-release.apk) in the apk branch
* [Latest Development Build](https://github.com/fossasia/badge-magic-android/raw/apk/badge-magic-development-release.apk) in the apk branch
* [Latest Release Build](https://github.com/fossasia/badgemagic-android/raw/apk/badge-magic-master-release.apk) in the apk branch
* [Latest Development Build](https://github.com/fossasia/badgemagic-android/raw/apk/badge-magic-development-release.apk) in the apk branch

## Permissions
* **Bluetooth**: For sending org.fossasia.badgemagic.data to the badge.
Expand Down
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ apply plugin: 'kotlin-parcelize'
apply plugin: 'kotlin-kapt'

def KEYSTORE_FILE = rootProject.file('scripts/key.jks')
def TRAVIS_BUILD = System.getenv("TRAVIS") == "true" && KEYSTORE_FILE.exists()
def GITHUB_BUILD = System.getenv("GITHUB_ACTIONS") == "true" && KEYSTORE_FILE.exists()
def LOCAL_KEY_PRESENT = project.hasProperty('SIGNING_KEY_FILE') && rootProject.file(SIGNING_KEY_FILE).exists()

android {
Expand All @@ -19,8 +19,8 @@ android {
applicationId 'org.fossasia.badgemagic'
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 10
versionName '1.8.0'
versionCode 11
versionName '1.8.1'
vectorDrawables.useSupportLibrary = true
}

Expand All @@ -30,7 +30,7 @@ android {
}

signingConfigs {
if (TRAVIS_BUILD) {
if (GITHUB_BUILD) {
release {
storeFile KEYSTORE_FILE
storePassword System.getenv("STORE_PASS")
Expand All @@ -53,7 +53,7 @@ android {
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

if (LOCAL_KEY_PRESENT || TRAVIS_BUILD)
if (LOCAL_KEY_PRESENT || GITHUB_BUILD)
signingConfig signingConfigs.release
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class DrawerActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedLi
showMenu?.setGroupVisible(R.id.saved_group, false)
}
R.id.feedback -> {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/fossasia/badge-magic-android/issues")))
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/fossasia/badgemagic-android/issues")))
}
R.id.buy -> {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://badgemagic.fossasia.org/shop")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ class AboutFragment : BaseFragment() {
}

private fun contributorsLink() {
val url = "https://github.com/fossasia/badge-magic-android/graphs/contributors"
val url = "https://github.com/fossasia/badgemagic-android/graphs/contributors"
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
startActivity(intent)
}

private fun github() {
val url = "https://github.com/fossasia/badge-magic-android"
val url = "https://github.com/fossasia/badgemagic-android"
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
startActivity(intent)
}

private fun license() {
val url = "https://github.com/fossasia/badge-magic-android/blob/development/LICENSE"
val url = "https://github.com/fossasia/badgemagic-android/blob/development/LICENSE"
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
startActivity(intent)
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="about_fossasia" translatable="false">Developed by <a href="http://fossasia.org/">FOSSASIA</a>
<a href="https://github.com/fossasia/badge-magic-android/graphs/contributors">contributors</a>.
<a href="https://github.com/fossasia/badgemagic-android/graphs/contributors">contributors</a>.
</string>
<string name="moshi_github" translatable="false">https://github.com/square/moshi</string>
<string name="timber_github" translatable="false">https://github.com/JakeWharton/timber</string>
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Re-Release
10 changes: 1 addition & 9 deletions scripts/prep-key.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/bin/sh
set -e

export DEPLOY_BRANCH=${DEPLOY_BRANCH:-development}
export PUBLISH_BRANCH=${PUBLISH_BRANCH:-master}

if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_REPO_SLUG" != "fossasia/badge-magic-android" ] || ! [ "$TRAVIS_BRANCH" == "$DEPLOY_BRANCH" -o "$TRAVIS_BRANCH" == "$PUBLISH_BRANCH" ]; then
echo "We decrypt key only for pushes to the master or development branch and not PRs. So, skip."
exit 0
fi

openssl aes-256-cbc -K $encrypted_f10b5e0e5262_key -iv $encrypted_f10b5e0e5262_iv -in ./scripts/secrets.tar.enc -out ./scripts/secrets.tar -d
openssl aes-256-cbc -K $ENCRYPTED_F10B5E0E5262_KEY -iv $ENCRYPTED_F10B5E0E5262_IV -in ./scripts/secrets.tar.enc -out ./scripts/secrets.tar -d
tar xvf ./scripts/secrets.tar -C scripts/
2 changes: 1 addition & 1 deletion scripts/upload-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ git config --global user.email "[email protected]"

bundle exec fastlane buildAAB

git clone --quiet --branch=apk https://fossasia:[email protected]/fossasia/badge-magic-android apk > /dev/null
git clone --quiet --branch=apk https://fossasia:[email protected]/fossasia/badgemagic-android apk > /dev/null
cd apk

if [[ $TRAVIS_BRANCH =~ ^(master)$ ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/upload-gh-pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cd docs/sources

make html

git clone --quiet --branch=gh-pages https://fossasia:[email protected]/fossasia/badge-magic-android gh-pages > /dev/null
git clone --quiet --branch=gh-pages https://fossasia:[email protected]/fossasia/badgemagic-android gh-pages > /dev/null
cd gh-pages

rm -rf *
Expand Down
2 changes: 1 addition & 1 deletion scripts/upload-ios-framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
git config --global user.name "Travis CI"
git config --global user.email "[email protected]"

git clone --quiet --branch=ios-framework https://fossasia:[email protected]/fossasia/badge-magic-android ios-framework > /dev/null
git clone --quiet --branch=ios-framework https://fossasia:[email protected]/fossasia/badgemagic-android ios-framework > /dev/null
cd ios-framework

rm -rf $TRAVIS_BRANCH
Expand Down
Loading