Skip to content

Commit

Permalink
Add workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
eggerk committed Oct 12, 2020
1 parent 4710877 commit 775a559
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 16 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags: [ "v*" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev
- name: Install Cargo dependencies
run: cargo install cargo-deb
- name: Create package
run: cargo deb --verbose
- name: Export Debian name
id: export_deb
run: |
DEB_PATH=$(find target/debian -name \*.deb | tail -n 1)
DEB_NAME=$(basename "$DEB_PATH")
echo "::set-output name=deb_path::$DEB_PATH"
echo "::set-output name=deb_name::$DEB_NAME"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./${{ steps.export_deb.outputs.deb_path }}
asset_name: ${{ steps.export_deb.outputs.deb_name }}
asset_content_type: application/x-debian-package
28 changes: 12 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@ env:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Package
run: cargo install cargo-deb && cargo deb --verbose
- name: Archive generated package
uses: actions/upload-artifact@v2
with:
name: debian_packages
path: target/debian/*.deb
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev
- name: Install Cargo dependencies
run: cargo install cargo-deb
- name: Create package
run: cargo deb --verbose
- name: Archive generated package
uses: actions/upload-artifact@v2
with:
name: debian_packages.zip
path: target/debian/*.deb

0 comments on commit 775a559

Please sign in to comment.