-
Notifications
You must be signed in to change notification settings - Fork 13
109 lines (103 loc) · 3.07 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Release
defaults:
run:
shell: bash
on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: setup release environment
run: |-
echo '${{secrets.DOCKERHUB_USERNAME}}:${{secrets.DOCKERHUB_TOKEN}}:docker.io' > .docker-creds
echo 'DOCKER_CREDS_FILE=.docker-creds' > .release-env
echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' >> .release-env
- name: Run GoReleaser
run: |-
sudo rm -rf dist
make release
build-mobile:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK
run: |
curl -o sdk-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
unzip sdk-tools.zip -d $HOME/android-sdk
echo "y" | $HOME/android-sdk/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk "platform-tools" "build-tools;30.0.3"
export PATH=$PATH:$HOME/android-sdk/platform-tools
rm sdk-tools.zip
go mod tidy
- name: Install gomobile
run: go install golang.org/x/mobile/cmd/gomobile@latest
- name: Build android aar
run: |
make android
- name: Git checkout
run: |
git checkout .
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist --config .goreleaser-mobile.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-wasm:
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Build wasm
run: |
make wasm
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist --config .goreleaser-wasm.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}