2022-07-01 12:11:32 +02:00
|
|
|
# Vendors Go modules and publishes tarball
|
2022-03-08 12:42:58 +01:00
|
|
|
name: tarball
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate_tarball:
|
|
|
|
runs-on: "ubuntu-20.04"
|
2022-07-01 12:11:32 +02:00
|
|
|
permissions: # See https://github.com/ooni/probe/issues/2154
|
|
|
|
contents: write
|
|
|
|
|
2022-03-08 12:42:58 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-06-17 20:12:14 +02:00
|
|
|
go-version: "1.18.3"
|
2022-03-08 12:42:58 +01:00
|
|
|
- name: Generate release tarball
|
|
|
|
run: |
|
|
|
|
VERSION=${GITHUB_REF_NAME#v}
|
|
|
|
go mod vendor
|
|
|
|
tar czf ooni-probe-cli-${VERSION}.tar.gz --transform "s,^,ooni-probe-cli-${VERSION}/," *
|
|
|
|
- name: Upload release tarball
|
|
|
|
run: |
|
|
|
|
gh release create -p $GITHUB_REF_NAME --target $GITHUB_SHA || true
|
|
|
|
gh release upload $GITHUB_REF_NAME --clobber ooni-probe-cli-*.tar.gz
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|