Skip to content

Commit 2ad02f5

Browse files
committed
Upload full source code as well including all go deps
1 parent bc17c04 commit 2ad02f5

1 file changed

Lines changed: 41 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
type: boolean
1616

1717
env:
18-
RUNNER_DEV_VERSION: "0.9.x"
18+
RUNNER_DEV_VERSION: "0.11.x"
1919
RUNNER_SERVER_VERSION: "3.11.16"
2020
jobs:
2121
build:
@@ -28,7 +28,7 @@ jobs:
2828
#
2929
fail-fast: false
3030
matrix:
31-
include:
31+
include: &buildVariants
3232
# go tool dist list -json to get the source
3333
- {GOOS: android, GOARCH: 386, TARGET: i686-linux-android }
3434
- {GOOS: android, GOARCH: amd64, TARGET: x86_64-linux-android }
@@ -75,10 +75,12 @@ jobs:
7575
env:
7676
CGO_ENABLED: 0 # Only android should build with cgo
7777
steps:
78-
- uses: actions/checkout@v4
78+
- &checkout
79+
uses: actions/checkout@v4
7980
with:
8081
submodules: recursive
81-
- name: Setup Go
82+
- &setupgo
83+
name: Setup Go
8284
uses: actions/setup-go@v5
8385
with:
8486
go-version: "${{ matrix.GOVERSION || vars.GOVERSION || '^1.16.0' }}"
@@ -148,14 +150,48 @@ jobs:
148150
name: bundle-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}
149151
path: |
150152
binary-${{matrix.GOOS}}-${{matrix.GOARCH}}${{matrix.GOARM}}.*
153+
create-vendor-archive:
154+
name: Create Archive with all dependencies
155+
runs-on: ubuntu-latest
156+
strategy:
157+
matrix:
158+
include:
159+
- buildVariants: *buildVariants
160+
steps:
161+
- *checkout
162+
- *setupgo
163+
- name: Run go mod vendor for each target
164+
uses: actions/github-script@v7
165+
with:
166+
script: |
167+
const targets = ${{ tojson(matrix.buildVariants) }};
168+
for (const env of targets) {
169+
const envVars = {
170+
...process.env,
171+
...env
172+
};
173+
await exec.exec(`go`, ['env'], { env: envVars });
174+
await exec.exec(`go`, ['mod', 'vendor'], { env: envVars });
175+
}
176+
- name: Package
177+
run: |
178+
zip -r github-act-runner-full-src.zip . -x ".git/*" github-act-runner-full-src.zip github-act-runner-full-src.tar.gz
179+
tar --exclude=.git --exclude=github-act-runner-full-src.zip --exclude=github-act-runner-full-src.tar.gz -czf github-act-runner-full-src.tar.gz .
180+
- uses: actions/upload-artifact@v4
181+
with:
182+
name: vendor
183+
path: |
184+
github-act-runner-full-src.*
151185
152186
#######################################
153187
########## publish to github ##########
154188
#######################################
155189
publish-to-github:
156190
name: deploy to github
157191
runs-on: ubuntu-latest
158-
needs: build
192+
needs:
193+
- build
194+
- create-vendor-archive
159195
if: ${{ github.event.inputs.skip-packaging != 'true' && github.event.inputs.version }}
160196
continue-on-error: true
161197
steps:

0 commit comments

Comments
 (0)