mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2026-05-09 18:11:26 +08:00
Update Meta Core to v1.16.0 and add actions to help maintain the project (#147)
* add: Create dependabot.yml * chore: Create update-dependencies.yml * chore: Update update-dependencies.yml * fix: switch meta core upstream * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update update-dependencies.yml * chore: Update build-unsigned.yaml * chore: Delete .github/dependabot.yml * chore: Run build-unsigned for each PR * chore: Better PR info and add repo dispatch listener * chore: Better actions name * chore: rename ci file and try to fix failure * chore: add manual auto project version bump * chore: Fix wrong command usage * chore: fix path * chore: Fix * chore: Fix bump project version * chore: can this pass compile? * chore: update core to newest alpha * Update update-dependencies.yaml * chore: try to change core upstream * chore: remove all go get update to pass compile * Revert "chore: remove all go get update to pass compile" This reverts commitaad0ec3b83. * Revert "chore: can this pass compile?" This reverts commit635289639b. * chore: force update submodule * chore: change upstream to alpha * chore: remove rubbish * chore: change upstream and update core * chore: add version fixed packages * chore: small fix * chore: update go dependencies * chore: revert some depends to old versions to fix compile * fix: fix compile error caused by core's deprecation * chore: fix actions and update core * chore: update clash core * fix: fix block calling * chore: update app version * chore: small fix to actions * feat: add Hysteria2 for UI * chore: revert version update for actions test * chore: try recover main go mod upgrade * chore: fix tag logic in release actions * Bump version to 2.8.10 (208010) * chore: remove test code in actions --------- Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
2
.github/workflows/build-pre-release.yaml
vendored
2
.github/workflows/build-pre-release.yaml
vendored
@@ -1,4 +1,4 @@
|
||||
name: build_pre_release
|
||||
name: Build Pre-Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
58
.github/workflows/build-release.yaml
vendored
58
.github/workflows/build-release.yaml
vendored
@@ -1,10 +1,15 @@
|
||||
name: build_release
|
||||
name: Build Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*' #
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
auto-bump-version:
|
||||
description: 'Auto bump project version before building release'
|
||||
required: false
|
||||
type: boolean
|
||||
|
||||
jobs:
|
||||
BuildRelease:
|
||||
@@ -35,6 +40,40 @@ jobs:
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
# If auto-bump-version is chosen BEGIN
|
||||
- name: Configure Git
|
||||
if: ${{ inputs.auto-bump-version }}
|
||||
run: |
|
||||
git config --global user.name 'GitHub Action'
|
||||
git config --global user.email 'action@github.com'
|
||||
|
||||
- name: Auto bump project version
|
||||
if: ${{ inputs.auto-bump-version }}
|
||||
id: bump-version
|
||||
run: |
|
||||
versionCode=$(grep -oP 'versionCode = \K\d+' build.gradle.kts)
|
||||
versionName=$(grep -oP 'versionName = "\K[0-9.]+' build.gradle.kts)
|
||||
major=$(echo $versionName | cut -d. -f1)
|
||||
minor=$(echo $versionName | cut -d. -f2)
|
||||
patch=$(echo $versionName | cut -d. -f3)
|
||||
newPatch=$((patch + 1))
|
||||
newVersionName="$major.$minor.$newPatch"
|
||||
newVersionCode=$((versionCode + 1))
|
||||
sed -i "s/versionCode = $versionCode/versionCode = $newVersionCode/" build.gradle.kts
|
||||
sed -i "s/versionName = \"$versionName\"/versionName = \"$newVersionName\"/" build.gradle.kts
|
||||
echo "::set-output name=newVersionName::$newVersionName"
|
||||
echo "::set-output name=newVersionCode::$newVersionCode"
|
||||
|
||||
- name: Commit modified version code and make new tag
|
||||
if: ${{ inputs.auto-bump-version }}
|
||||
run: |
|
||||
newVersionName=${{ steps.bump-version.outputs.newVersionName }}
|
||||
newVersionCode=${{ steps.bump-version.outputs.newVersionCode }}
|
||||
git commit -am "Bump version to $newVersionName ($newVersionCode)"
|
||||
git tag "v$newVersionName"
|
||||
git push --follow-tags
|
||||
# If auto-bump-version is chosen END
|
||||
|
||||
- name: Signing properties
|
||||
env:
|
||||
@@ -55,16 +94,21 @@ jobs:
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
arguments: --no-daemon app:assembleMetaRelease
|
||||
|
||||
- name: Set current tag
|
||||
id: current_tag
|
||||
run: echo ::set-output name=tag::$(git describe --tags --abbrev=0)
|
||||
|
||||
- name: Get real tag value (current or auto-bumped?)
|
||||
id: real_tag
|
||||
run: |
|
||||
if [[ "${{ inputs.auto-bump-version }}" == "true" ]]; then
|
||||
echo "::set-output name=tag::v${{ steps.bump-version.outputs.newVersionName }}"
|
||||
else
|
||||
echo "::set-output name=tag::$(git describe --tags --abbrev=0)
|
||||
fi
|
||||
|
||||
- name: Tag Repo
|
||||
uses: richardsimko/update-tag@v1
|
||||
with:
|
||||
tag: ${{ steps.current_tag.outputs.tag }}
|
||||
tag_name: ${{ steps.current_tag.outputs.tag }}
|
||||
tag: ${{ steps.real_tag.outputs.tag }}
|
||||
tag_name: ${{ steps.real_tag.outputs.tag }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
11
.github/workflows/build-unsigned.yaml
vendored
11
.github/workflows/build-unsigned.yaml
vendored
@@ -1,5 +1,7 @@
|
||||
name: Build Unsigned
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@@ -8,17 +10,21 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout submodules
|
||||
run: git submodule update --init --recursive --remote --force
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20"
|
||||
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
@@ -27,6 +33,7 @@ jobs:
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Build
|
||||
uses: gradle/gradle-build-action@v2
|
||||
with:
|
||||
|
||||
78
.github/workflows/update-dependencies.yaml
vendored
Normal file
78
.github/workflows/update-dependencies.yaml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: Update Clash-Core and Go Modules
|
||||
on:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- core-updated
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
# go dependencies that should be fixed to certain version
|
||||
PACKAGES_DO_NOT_UPGRADE: >-
|
||||
github.com/Dreamacro/clash@v1.7.1
|
||||
github.com/Kr328/tun2socket@v0.0.0-20220414050025-d07c78d06d34
|
||||
|
||||
jobs:
|
||||
update-dependencies:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout submodules
|
||||
run: git submodule update --init --recursive --remote --force
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: "1.20"
|
||||
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.cache/go-build
|
||||
~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Download GeoIP Database
|
||||
run: |
|
||||
./gradlew :core:downloadGeoipDatabase
|
||||
|
||||
- name: Update Foss Gomod
|
||||
run: |
|
||||
cd ${{ github.workspace }}/core/src/foss/golang/
|
||||
go get -u ${{ env.PACKAGES_DO_NOT_UPGRADE }}
|
||||
|
||||
- name: Update Main Gomod
|
||||
run: |
|
||||
cd ${{ github.workspace }}/core/src/main/golang/native/
|
||||
go get -u -d ${{ env.PACKAGES_DO_NOT_UPGRADE }}
|
||||
|
||||
- name: Create Pull Request
|
||||
id: cpr
|
||||
uses: peter-evans/create-pull-request@v5
|
||||
with:
|
||||
commit-message: Update Dependencies
|
||||
branch: update-dependencies
|
||||
delete-branch: true
|
||||
title: 'Update Dependencies'
|
||||
draft: false
|
||||
body: |
|
||||
- Update Clash-Meta Core
|
||||
- Update Go Module Dependecies
|
||||
labels: |
|
||||
Update
|
||||
|
||||
- name: PR result
|
||||
if: ${{ steps.cpr.outputs.pull-request-number }}
|
||||
run: |
|
||||
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
|
||||
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
|
||||
|
||||
Reference in New Issue
Block a user