添加web页面支持展示二维码,默认web端口34323 #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
permissions: | |
contents: write | |
jobs: | |
gateway-go: | |
runs-on: ubuntu-latest | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.20 | |
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3 | |
- uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3 | |
- name: Install Snapcraft | |
run: | | |
sudo snap install snapcraft --classic | |
mkdir -p $HOME/.cache/snapcraft/download | |
mkdir -p $HOME/.cache/snapcraft/stage-packages | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: openiothub | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
gomobile-android-libs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.20 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- uses: nttld/setup-ndk@v1 | |
id: setup-ndk | |
with: | |
ndk-version: r21e | |
add-to-path: false | |
- name: Test golang code | |
run: go test ./... | |
- name: install and setup gomobile | |
run: | | |
go install golang.org/x/mobile/cmd/gobind@latest | |
go install golang.org/x/mobile/cmd/gomobile@latest | |
go get -u golang.org/x/mobile/... | |
gomobile init | |
gomobile version | |
gomobile clean | |
env: | |
GO111MODULE: on | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
- name: build android aar | |
run: gomobile bind -target=android -o gateway.aar ./client | |
env: | |
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} | |
- name: Release gateway.aar | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
gateway.aar | |
gomobile-apple-libs: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.20 | |
- name: Test golang code | |
run: go test ./... | |
- name: install and setup gomobile | |
run: | | |
go install golang.org/x/mobile/cmd/gobind@latest | |
go install golang.org/x/mobile/cmd/gomobile@latest | |
go get -u golang.org/x/mobile/... | |
gomobile init | |
gomobile version | |
gomobile clean | |
env: | |
GO111MODULE: on | |
- name: build ios xcframework | |
run: gomobile bind -ldflags '-w -s -extldflags "-lresolve"' --target=ios,macos,iossimulator -o OpenIoTHubGateway.xcframework ./client | |
- run: zip -r OpenIoTHubGateway.xcframework.zip OpenIoTHubGateway.xcframework | |
- name: Release OpenIoTHubGateway.xcframework | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
OpenIoTHubGateway.xcframework.zip |