ooni-probe-cli/.github/workflows/tarball.yml

42 lines
1.1 KiB
YAML
Raw Normal View History

# Vendors Go modules and publishes tarball
name: tarball
on:
push:
branches:
- "fullbuild"
tags:
- "v*"
jobs:
generate_tarball:
runs-on: "ubuntu-20.04"
permissions: # See https://github.com/ooni/probe/issues/2154
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get GOVERSION content
id: goversion
run: echo ::set-output name=version::$(cat GOVERSION)
- uses: actions/setup-go@v3
with:
go-version: "${{ steps.goversion.outputs.version }}"
- 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 }}