2020-05-29 15:06:02 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths:
|
|
|
|
- "**.go"
|
|
|
|
- "go.*"
|
|
|
|
- "**/testdata/**"
|
|
|
|
- ".ci/**"
|
|
|
|
- ".git*"
|
|
|
|
- ".github/workflows/releases.yml"
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- "**.go"
|
|
|
|
- "go.*"
|
|
|
|
- "**/testdata/**"
|
|
|
|
- ".ci/**"
|
|
|
|
- ".git*"
|
|
|
|
- ".github/workflows/releases.yml"
|
2020-03-26 11:02:19 +01:00
|
|
|
|
2020-06-20 19:38:58 +02:00
|
|
|
name: GitHub CI
|
2020-03-26 11:02:19 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Get the version
|
|
|
|
id: get_version
|
|
|
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
|
|
|
|
2021-03-30 11:57:10 +02:00
|
|
|
- name: Set up Go
|
2022-03-07 17:01:40 +01:00
|
|
|
uses: actions/setup-go@v3
|
2020-03-26 11:02:19 +01:00
|
|
|
with:
|
2021-03-30 11:57:10 +02:00
|
|
|
go-version: 1
|
2020-03-26 11:02:19 +01:00
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
2022-03-02 10:15:29 +01:00
|
|
|
uses: actions/checkout@v3
|
2020-03-26 11:02:19 +01:00
|
|
|
|
|
|
|
- name: Test suite
|
|
|
|
run: |
|
|
|
|
go version
|
2021-03-30 11:03:25 +02:00
|
|
|
go mod vendor
|
2020-03-26 11:02:19 +01:00
|
|
|
cd .ci
|
|
|
|
./ci-test.sh
|
|
|
|
cd -
|
|
|
|
|
|
|
|
- name: Build all
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
run: |
|
|
|
|
.ci/ci-build.sh "${{ steps.get_version.outputs.VERSION }}"
|
|
|
|
|
|
|
|
- name: Install minisign and sign
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y install libsodium-dev
|
|
|
|
git clone --depth 1 https://github.com/jedisct1/minisign.git
|
|
|
|
cd minisign/src
|
|
|
|
mkdir -p /tmp/bin
|
|
|
|
cc -O2 -o /tmp/bin/minisign -D_GNU_SOURCE *.c -lsodium
|
|
|
|
cd -
|
|
|
|
/tmp/bin/minisign -v
|
|
|
|
echo '#' > /tmp/minisign.key
|
|
|
|
echo "${{ secrets.MINISIGN_SK }}" >> /tmp/minisign.key
|
|
|
|
cd dnscrypt-proxy
|
|
|
|
echo | /tmp/bin/minisign -s /tmp/minisign.key -Sm *.tar.gz *.zip
|
|
|
|
ls -l dnscrypt-proxy*
|
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
|
|
|
release_name: Release ${{ github.ref }}
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|
|
|
|
|
|
|
|
- name: Upload release assets
|
2022-10-24 10:10:58 +02:00
|
|
|
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
|
2020-03-26 11:02:19 +01:00
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
dnscrypt-proxy/*.zip
|
|
|
|
dnscrypt-proxy/*.tar.gz
|
|
|
|
dnscrypt-proxy/*.minisig
|