-
Notifications
You must be signed in to change notification settings - Fork 34
55 lines (50 loc) · 1.65 KB
/
publish.yml
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
name: Publish
permissions:
# for Upload binaries to release
contents: write
on:
push:
tags:
- '*'
jobs:
build:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
artifact_name: capsule
suffix: x86_64-linux
- os: macos-latest
artifact_name: capsule
suffix: x86_64-darwin
steps:
- uses: actions/checkout@v1
- name: Set RELEASE_VERSION
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Set PKG_NAME
run: echo "PKG_NAME=capsule_${RELEASE_VERSION}_${{ matrix.suffix }}" >> $GITHUB_ENV
- name: Build (static link openssl)
if: ${{ matrix.suffix == 'x86_64-linux' }}
run: cargo build --features=reqwest/native-tls-vendored --release --locked
- name: Build
if: ${{ matrix.suffix != 'x86_64-linux' }}
run: cargo build --release --locked
- name: Extract signing key
working-directory: dev-tools
run: openssl aes-256-cbc -d -K ${{ secrets.SIGNING_SECRET_KEY }} -iv ${{ secrets.SIGNING_SECRET_IV }} -in signing-secret.asc.enc -out signing-secret.asc
- name: Import signing key
working-directory: dev-tools
run: gpg --import signing-secret.asc
- name: Sign
env:
GPG_SIGNER: Developer Tools
run: dev-tools/package.sh target/release/${{ matrix.artifact_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: releases/*
tag: ${{ github.ref }}
file_glob: true