Skip to content

Commit

Permalink
Try to automate the publication of releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Nov 1, 2020
1 parent d8def69 commit c58b1b3
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 38 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}

- uses: actions/checkout@master

- uses: hecrj/setup-rust-action@master
with:
rust-version: stable

- name: Check Cargo availability
run: cargo --version

- name: Check Rustup default toolchain
run: rustup default | grep stable

- name: Install cargo-deb
run: cargo install --debug cargo-deb

- name: Build
run: |
echo 'lto = "fat"' >> Cargo.toml
env RUSTFLAGS="-C link-arg=-s" cargo build --release
mkdir encrypted-dns
mv target/release/encrypted-dns encrypted-dns/
cp README.md example-encrypted-dns.toml encrypted-dns/
tar cJpf encrypted-dns_${{ steps.get_version.outputs.VERSION }}_linux-x86_64.tar.bz2 encrypted-dns
- name: Debian package
run: |
cargo deb
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false

- name: Upload Debian package
id: upload-release-asset-debian
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: "encrypted-dns_${{ steps.get_version.outputs.VERSION }}_amd64.deb"
asset_path: "target/debian/encrypted-dns_${{ steps.get_version.outputs.VERSION }}_amd64.deb"
asset_content_type: application/x-debian-package

- name: Upload tarball
id: upload-release-asset-tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: "encrypted-dns_${{ steps.get_version.outputs.VERSION }}_linux-x86_64.tar.bz2"
asset_path: "encrypted-dns_${{ steps.get_version.outputs.VERSION }}_linux-x86_64.tar.bz2"
asset_content_type: application/x-tar
37 changes: 0 additions & 37 deletions .github/workflows/rust.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- uses: hecrj/setup-rust-action@master
with:
rust-version: nightly
- name: Check Cargo availability
run: cargo --version
- name: Check Rustup default toolchain
run: rustup default | grep nightly
- name: Test
run: |
cargo test
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "encrypted-dns"
version = "0.3.19"
version = "0.3.20"
authors = ["Frank Denis <github@pureftpd.org>"]
edition = "2018"
description = "A modern encrypted DNS server (DNSCrypt v2, Anonymized DNSCrypt, DoH)"
Expand Down

0 comments on commit c58b1b3

Please sign in to comment.