diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b917609..291533b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,9 +80,10 @@ jobs: xmake --version - name: cert run: | + go build script/cert.go cd project/android echo "org.gradle.java.home=$JAVA_HOME_11_X64" >> gradle.properties - ../../script/cert.sh "${{ secrets.GITHUB_TOKEN }}" cert.tar.xz + ../../cert "${{ secrets.GITHUB_TOKEN }}" cert.tar.xz tar -xf cert.tar.xz rm cert.tar.xz ls -lh keystore.properties release.keystore diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..682ea4b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/zeromake/onscripter + +go 1.16 diff --git a/script/cert.go b/script/cert.go new file mode 100644 index 0000000..ab25928 --- /dev/null +++ b/script/cert.go @@ -0,0 +1,29 @@ +package main + +import ( + "encoding/base64" + "log" + "os" +) + +func main() { + var cert = os.Args[1] + var out = os.Args[2] + bb, err := base64.StdEncoding.DecodeString(cert) + if err != nil { + log.Fatal(err) + } + f, err := os.OpenFile(out, os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + log.Fatal(err) + } + _, err = f.Write(bb) + if err != nil { + log.Fatal(err) + } + err = f.Close() + if err != nil { + log.Fatal(err) + } + log.Println("done") +}