Skip to content

v7.1.0

v7.1.0 #8

Workflow file for this run

name: Release APK
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
tag:
description: 'Release Tag'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
- name: Setup Android environment
uses: android-actions/setup-android@v3
- name: Install gomobile
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Build XrayCore
run: |
cd XrayCore
go mod download
gomobile init
gomobile bind -o "../app/libs/XrayCore.aar" -androidapi 21 -ldflags="-s -w -buildid=" -v -trimpath .
- name: Build APK
run: |
chmod 755 gradlew
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
echo "${{ secrets.KS_FILE }}" > /tmp/xray_base64.txt
base64 -d /tmp/xray_base64.txt > /tmp/xray.jks
./gradlew assembleRelease
- name: Set VERSION_CODE
run: |
ALL_VARIANTS=4
VERSION_CODE=$(cat "$GITHUB_WORKSPACE/app/versionCode.txt")
((VERSION_CODE += ALL_VARIANTS))
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
- name: Set tag name
id: tag_name
run: echo "tag_name=${{ github.event.inputs.tag || github.ref_name }}" >> $GITHUB_OUTPUT
- name: Publish release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag_name.outputs.tag_name }}
name: ${{ steps.tag_name.outputs.tag_name }}
prerelease: false
draft: false
files: "${{ github.workspace }}/app/build/outputs/apk/release/*.apk"
body_path: ${{ github.workspace }}/metadata/en-US/changelogs/${{ env.VERSION_CODE }}.txt