Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
This workflow compiles syntaxdot-ffi and creates an archive with the
shared library, header, and protobuf file.
  • Loading branch information
danieldk committed Oct 27, 2020
1 parent 9d8b0c1 commit 6048ea3
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- name: Get release version
run: echo ::set-env name=TAG_NAME::$(echo ${GITHUB_REF:10})
- name: Install dependencies
run: sudo apt-get install cmake pkg-config libssl-dev
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Create release archive
id: create_archive
run: |
DIST=syntaxdot-ffi-${TAG_NAME}-x86_64-linux-gnu-gcc
ARCHIVE=${DIST}.tar.gz
install -Dm755 -t ${DIST}/lib target/release/libsyntaxdot_ffi.so
install -Dm644 -t ${DIST}/include include/syntaxdot.h
install -Dm644 -t ${DIST}/share/syntaxdot/proto proto/syntaxdot.proto
tar -czvf ${ARCHIVE} ${DIST}
echo ::set-output name=ASSET::$ARCHIVE
- uses: actions/[email protected]
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.create_archive.outputs.ASSET }}
asset_name: ${{ steps.create_archive.outputs.ASSET }}
asset_content_type: application/gzip

0 comments on commit 6048ea3

Please sign in to comment.