Repository navigation
116 lines (105 loc) · 3.39 KB
/
Copy pathtinygo.yml
File metadata and controls
116 lines (105 loc) · 3.39 KB
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
109
110
111
112
113
114
115
116
# Pinned first-party actions (bump tag and SHA together when upgrading):
# actions/checkout@v7.0.1 3d3c42e5aac5ba805825da76410c181273ba90b1
# actions/upload-artifact@v7.0.1 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
#
name: TinyGo Build
on:
push:
branches: [tinygo]
pull_request:
branches: [tinygo]
workflow_dispatch:
concurrency:
group: tinygo-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
actions: read # run/job metadata for harden-runner
env:
# harden-runner egress allowlist (block mode). One union list covers
# every job in this workflow.
HR_ENDPOINTS: >-
github.com:443
api.github.com:443
codeload.github.com:443
release-assets.githubusercontent.com:443
objects.githubusercontent.com:443
*.actions.githubusercontent.com:443
*.blob.core.windows.net:443
*.githubapp.com:443
prod.app-api.stepsecurity.io:443
agent.api.stepsecurity.io:443
azure.archive.ubuntu.com:80
azure.archive.ubuntu.com:443
archive.ubuntu.com:80
security.ubuntu.com:80
motd.ubuntu.com:443
esm.ubuntu.com:443
packages.microsoft.com:443
ppa.launchpadcontent.net:443
go.dev:443
dl.google.com:443
storage.googleapis.com:443
CI_GO_VERSION: "1.27.4"
CI_TASK_VERSION: "3.46.3"
CI_TINYGO_VERSION: "0.37.0"
TINYGO_DEB_SHA256: "8f34a4aac7f1aa2ad51dc0f4eccd40da13b6f52fbac5c13887d57327e5f0a862"
GOFLAGS: -mod=vendor
GOPROXY: "off"
GOTOOLCHAIN: local
jobs:
tinygo-build:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: tinygo-default
task: tinygo-build
output: reticulum-go-tinygo
- name: tinygo-wasm
task: tinygo-wasm
output: reticulum-go.wasm
steps:
- name: Harden runner
uses: step-security/harden-runner@e14015d583714f6e62063499dc959a02595150a1 # v2.21.1
with:
egress-policy: block
allowed-endpoints: ${{ env.HR_ENDPOINTS }}
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup CI
uses: $/.github/actions/setup-ci
with:
go_version: ${{ env.CI_GO_VERSION }}
task_version: ${{ env.CI_TASK_VERSION }}
- name: Apt update (for TinyGo .deb)
run: sh scripts/ci/exec-priv.sh apt-get update -qq
- name: Install TinyGo
run: sh scripts/ci/setup-tinygo.sh "${CI_TINYGO_VERSION}"
- name: Build with TinyGo
env:
TINYGO_TASK: ${{ matrix.task }}
TINYGO_OUTPUT: ${{ matrix.output }}
run: |
set -euo pipefail
task "${TINYGO_TASK}"
output_name="${TINYGO_OUTPUT}"
if [ -f "bin/${output_name}" ]; then
sha256sum "bin/${output_name}" | cut -d' ' -f1 > "bin/${output_name}.sha256"
echo "Built: ${output_name}"
else
echo "Build output not found: bin/${output_name}" >&2
ls -la bin/
exit 1
fi
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.name }}
path: bin/${{ matrix.output }}*
if-no-files-found: error