chore: Gitea Action
This commit is contained in:
parent
b81abe384a
commit
5b9b51c02d
24
.gitea/workflows/common_build.yml
Normal file
24
.gitea/workflows/common_build.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
name: Build
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
BuildAndTest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Fetch tags
|
||||||
|
run: git fetch --tags -p
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '17'
|
||||||
|
- name: Setup Android SDK
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
- name: Configure gradle...
|
||||||
|
run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
|
||||||
|
- name: Build and test
|
||||||
|
run: ./gradlew build --stacktrace
|
@ -1,33 +1,51 @@
|
|||||||
name: Tag
|
name: Create tag
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release
|
- release
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
uses: ./.gitea/workflows/common_build.yml
|
||||||
createTagAndChangelog:
|
createTagAndChangelog:
|
||||||
needs: BuildAndTest
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Creating the tag
|
- name: Config git
|
||||||
|
run: |
|
||||||
|
git config --global user.email aminecmi+giteadrone@pm.me
|
||||||
|
git config --global user.name giteadrone
|
||||||
|
- name: Creating the tag and generate changelog
|
||||||
run: |
|
run: |
|
||||||
git fetch --tags -p
|
git fetch --tags -p
|
||||||
PREV=$(git describe --tags --abbrev=0)
|
PREV=$(git describe --tags --abbrev=0)
|
||||||
./build.sh --publish --from-ci
|
./build.sh --publish --from-ci
|
||||||
- name: Generating changelog
|
|
||||||
run: |
|
|
||||||
VER=$(git describe --tags --abbrev=0)
|
VER=$(git describe --tags --abbrev=0)
|
||||||
CHANGELOG=$(git log $PREV..HEAD --pretty="- %s")
|
CHANGELOG=$(git log $PREV..HEAD --pretty="- %s")
|
||||||
echo "**$VER**\n\n$CHANGELOG\n\n--------------------------------------------------------------------\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
|
echo "**$VER
|
||||||
|
|
||||||
|
$CHANGELOG
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
|
$(cat CHANGELOG.md)" > CHANGELOG.md
|
||||||
git add CHANGELOG.md
|
git add CHANGELOG.md
|
||||||
git config --global user.email "aminecmi+giteadrone@pm.me"
|
|
||||||
git config --global user.name "Gitea actions runner"
|
|
||||||
git commit -m "Changelog for $VER"
|
git commit -m "Changelog for $VER"
|
||||||
git push --tags
|
- name: Push changes
|
||||||
|
uses: appleboy/git-push-action@v1.0.0
|
||||||
|
with:
|
||||||
|
author_name: giteadrone
|
||||||
|
author_email: aminecmi+giteadrone@pm.me
|
||||||
|
remote: ${{ secrets.REMOTE_URL }}
|
||||||
|
followtags: true
|
||||||
|
ssh_key: ${{ secrets.PRIVATE_KEY }}
|
||||||
|
tags: true
|
||||||
|
branch: release
|
||||||
- name: copy file via ssh password
|
- name: copy file via ssh password
|
||||||
uses: appleboy/scp-action@v0.1.7
|
uses: appleboy/scp-action@v0.1.7
|
||||||
with:
|
with:
|
||||||
@ -43,3 +61,60 @@ jobs:
|
|||||||
username: ubuntu
|
username: ubuntu
|
||||||
key: ${{ secrets.PRIVATE_KEY }}
|
key: ${{ secrets.PRIVATE_KEY }}
|
||||||
script: cd /home/ubuntu && sudo rm -rf /var/www/amine/version.txt && sudo chown www-data:www-data ./version.txt && sudo mv version.txt /var/www/amine/
|
script: cd /home/ubuntu && sudo rm -rf /var/www/amine/version.txt && sudo chown www-data:www-data ./version.txt && sudo mv version.txt /var/www/amine/
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: createTagAndChangelog
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Fetch tags
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
git fetch --tags -p
|
||||||
|
PREV=$(git describe --tags --abbrev=0)
|
||||||
|
echo $PREV
|
||||||
|
echo "VERSION=$PREV" >> $GITHUB_OUTPUT
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '17'
|
||||||
|
- name: Setup Android SDK
|
||||||
|
uses: android-actions/setup-android@v3
|
||||||
|
- name: Configure gradle...
|
||||||
|
run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=false\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
|
||||||
|
- name: setup go
|
||||||
|
uses: https://github.com/actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '>=1.20.1'
|
||||||
|
- name: Generate APK
|
||||||
|
run: ./gradlew :androidApp:assembleGithubConfigRelease
|
||||||
|
- name: Get Key
|
||||||
|
run: wget ${{ secrets.KEY_URL }}
|
||||||
|
- name: Zippalign
|
||||||
|
run: |
|
||||||
|
sdkmanager "build-tools;31.0.0"
|
||||||
|
ls $ANDROID_HOME/build-tools
|
||||||
|
$ANDROID_HOME/build-tools/31.0.0/zipalign -f -v 4 androidApp/build/outputs/apk/githubConfig/release/androidApp-githubConfig-release-unsigned.apk androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk
|
||||||
|
- name: Sigh
|
||||||
|
run: $ANDROID_HOME/build-tools/31.0.0/apksigner sign -v --out signed.apk --ks ./key --ks-key-alias ${{ secrets.KEY_ALIAS }} --ks-pass pass:${{ secrets.KEYSTORE_PASSWORD }} --v1-signing-enabled true --v2-signing-enabled true androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk
|
||||||
|
- name: Verify
|
||||||
|
run: $ANDROID_HOME/build-tools/31.0.0/apksigner verify signed.apk
|
||||||
|
- name: Release
|
||||||
|
uses: https://gitea.com/actions/gitea-release-action@main
|
||||||
|
with:
|
||||||
|
files: signed.apk
|
||||||
|
token: ${{ secrets.API_KEY }}
|
||||||
|
tag_name: ${{ steps.version.outputs.VERSION }}
|
||||||
|
- name: Send mail
|
||||||
|
uses: https://github.com/dawidd6/action-send-mail@v4
|
||||||
|
with:
|
||||||
|
connection_url: ${{ secrets.MAIL_CONNECTION }}
|
||||||
|
to: ${{ secrets.MAIL_TO }}
|
||||||
|
from: ${{ secrets.MAIL_FROM }}
|
||||||
|
subject: Mapping file
|
||||||
|
priority: high
|
||||||
|
convert_markdown: true
|
||||||
|
body: Nouveau fichier de mapping
|
||||||
|
attachments: androidApp/build/outputs/mapping/githubConfigRelease/mapping.txt
|
@ -1,4 +1,4 @@
|
|||||||
name: Push/PR Steps
|
name: Check PR code
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
@ -22,3 +22,5 @@ jobs:
|
|||||||
run: ktlint 'shared/**/*.kt' 'androidApp/**/*.kt' '!shared/build' || true
|
run: ktlint 'shared/**/*.kt' 'androidApp/**/*.kt' '!shared/build' || true
|
||||||
- name: Detecting...
|
- name: Detecting...
|
||||||
run: ./detekt-cli-1.23.1/bin/detekt-cli --all-rules --excludes '**/shared/build/**/*.kt' || true
|
run: ./detekt-cli-1.23.1/bin/detekt-cli --all-rules --excludes '**/shared/build/**/*.kt' || true
|
||||||
|
build:
|
||||||
|
uses: ./.gitea/workflows/common_build.yml
|
@ -1,30 +1,9 @@
|
|||||||
name: Push/PR Steps
|
name: Check master code
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- release
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
BuildAndTest:
|
build:
|
||||||
runs-on: ubuntu-latest
|
uses: ./.gitea/workflows/common_build.yml
|
||||||
steps:
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Fetch tags
|
|
||||||
run: git fetch --tags -p
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '17'
|
|
||||||
- name: Setup Android SDK
|
|
||||||
uses: android-actions/setup-android@v3
|
|
||||||
- name: Configure gradle...
|
|
||||||
run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
|
|
||||||
- name: Build and test
|
|
||||||
run: ./gradlew build --stacktrace
|
|
@ -1,49 +0,0 @@
|
|||||||
name: Tag
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
steps:
|
|
||||||
- name: Check out repository code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Fetch tags
|
|
||||||
run: git fetch --tags -p
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '17'
|
|
||||||
- name: Setup Android SDK
|
|
||||||
uses: android-actions/setup-android@v3
|
|
||||||
- name: Configure gradle...
|
|
||||||
run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=false\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
|
|
||||||
- name: Generate APK
|
|
||||||
run: ./gradlew :androidApp:assembleGithubConfigRelease
|
|
||||||
- name: Get Key
|
|
||||||
run: wget ${{ secrets.KEY_URL }}
|
|
||||||
- name: Zippalign
|
|
||||||
run: $ANDROID_HOME/build-tools/31.0.0/zipalign -f -v 4 androidApp/build/outputs/apk/githubConfig/release/androidApp-githubConfig-release-unsigned.apk androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk
|
|
||||||
- name: Sigh
|
|
||||||
run: $ANDROID_HOME/build-tools/31.0.0/apksigner sign -v --out signed.apk --ks ./key --ks-key-alias ${{ secrets.KEY_ALIAS }} --ks-pass pass:${{ secrets.KEYSTORE_PASSWORD }} --v1-signing-enabled true --v2-signing-enabled true androidApp/build/outputs/apk/githubConfig/release/android-prod-released-ziped.apk
|
|
||||||
- name: Verify
|
|
||||||
run: $ANDROID_HOME/build-tools/31.0.0/apksigner verify signed.apk
|
|
||||||
- name: Release
|
|
||||||
uses: https://gitea.com/actions/release-action@main
|
|
||||||
with:
|
|
||||||
files: signed.apk
|
|
||||||
api_key: ${{ secrets.API_KEY }}
|
|
||||||
- name: Send mail
|
|
||||||
uses: https://github.com/dawidd6/action-send-mail@v4
|
|
||||||
with:
|
|
||||||
connection_url: ${{ secrets.MAIL_CONNECTION }}
|
|
||||||
to: ${{ secrets.MAIL_TO }}
|
|
||||||
from: ${{ secrets.MAIL_FROM }}
|
|
||||||
subject: Mapping file
|
|
||||||
priority: high
|
|
||||||
convert_markdown: true
|
|
||||||
body: Nouveu fichier de mapping
|
|
||||||
attachments: androidApp/build/outputs/mapping/githubConfigRelease/mapping.txt
|
|
@ -1,4 +1,4 @@
|
|||||||
# ReaderForSelfoss-multiplatform [![Build Status](https://build.amine-bouabdallaoui.fr/api/badges/Louvorg/ReaderForSelfoss-multiplatform/status.svg)](https://build.amine-bouabdallaoui.fr/Louvorg/ReaderForSelfoss-multiplatform)
|
# ReaderForSelfoss-multiplatform [![Build Status](https://gitea.amine-bouabdallaoui.fr/Louvorg/ReaderForSelfoss-multiplatform/actions/workflows/on_push.yml/badge.svg)](https://gitea.amine-bouabdallaoui.fr/Louvorg/ReaderForSelfoss-multiplatform/actions?workflow=on_push.yml&actor=0&status=0)
|
||||||
|
|
||||||
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/readerforselfoss/localized.svg)](https://crowdin.com/project/readerforselfoss)
|
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/readerforselfoss/localized.svg)](https://crowdin.com/project/readerforselfoss)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user