Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2232 from comit-network/release/0.7.0
Browse files Browse the repository at this point in the history
Release version 0.7.0
  • Loading branch information
thomaseizinger authored Mar 12, 2020
2 parents 25f612a + 55278cc commit 27f8862
Show file tree
Hide file tree
Showing 192 changed files with 12,544 additions and 11,264 deletions.
96 changes: 26 additions & 70 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,9 @@ workflows:
branches:
ignore: /^(staging.tmp|trying.tmp)$/
- release-build-test:
filters: # runs for "release/" branches and all tags.
filters: # runs for "release/" branches
branches:
only: /^release.*$/
tags:
only: /.*/
- publish-github-release:
requires:
- release-build-test
filters: # runs for no branches and only for X.Y.Z.
branches:
ignore: /.*/
tags:
only: /^\d+\.\d+\.\d+$/
only: /^release\/.*$/

jobs:
debug-build-test:
Expand All @@ -44,6 +34,7 @@ jobs:
- restore_caches
- install_rust
- install_node_devlibs
- install_lnd
- print_current_versions
- run:
name: Debug build and test
Expand All @@ -63,60 +54,13 @@ jobs:
- restore_caches
- install_rust
- install_node_devlibs
- install_lnd
- print_current_versions
- run:
name: Release build and test
command: |
export CND_BIN=~/comit/target/release/cnd
make ci BUILD_ARGS='--release'
- store_artifacts:
path: api_tests/log
- run:
name: Consolidate release binaries
command: |
set -v
mkdir ~/artifacts
mv -v ~/comit/target/release/cnd ~/artifacts
- persist_to_workspace:
root: ~/artifacts
paths:
- cnd

publish-github-release:
working_directory: ~/comit
machine:
image: ubuntu-1604:201903-01
environment:
RUST_TEST_THREADS: "8"
steps:
- attach_workspace:
at: ~/artifacts
- checkout
- restore_caches
- install_rust
- install_node_devlibs
- print_current_versions
- setup_remote_docker
- run:
name: "Package & Publish Release on GitHub and Docker Hub"
command: |
set -v
VERSION=$(cargo pkgid -- cnd|cut -d# -f2)
# Let's abort if the git tag does not match the version in Cargo.toml as it would be fishy
test "${VERSION}" = "${CIRCLE_TAG}"
mkdir ~/package
cd ~/artifacts && tar czvf ~/package/comit-rs_${VERSION}_$(uname -s)_$(uname -m).tar.gz *
go get github.com/tcnksm/ghr
ls ~/package/
ghr -t ${GITHUB_TOKEN_FOR_RELEASES} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ~/package/
echo $DOCKER_HUB_TOKEN | docker login -u thomaseizinger --password-stdin
docker build . -t comitnetwork/cnd:${VERSION} -t comitnetwork/cnd:latest
docker push comitnetwork/cnd:${VERSION}
docker push comitnetwork/cnd:latest
commands:
install_node_devlibs:
Expand All @@ -132,21 +76,35 @@ commands:
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
curl -sL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
echo "deb https://deb.nodesource.com/node_10.x/ trusty main" | sudo tee /etc/apt/sources.list.d/node_10.list
echo "deb https://deb.nodesource.com/node_12.x/ trusty main" | sudo tee /etc/apt/sources.list.d/node_12.list
sudo apt-get update
sudo apt-get install -y nodejs=10.* yarn
sudo apt-get install -y nodejs=12.* yarn
install_rust:
steps:
- run:
name: "Install Rust"
command: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(< rust-toolchain) && source $HOME/.cargo/env
rustup install nightly-2019-07-31
rustup component add rustfmt --toolchain nightly-2019-07-31
rustup install nightly-2020-01-15
rustup component add rustfmt --toolchain nightly-2020-01-15
# Define variables that need interpolation
# As CircleCI starts a new shell for each `run` declaration, we need to export cargo home to $BASH_ENV
echo 'export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH' >> $BASH_ENV
install_lnd:
steps:
- run:
name: "Install go 1.13 & lnd"
command: |
sudo rm -rf /usr/local/go
wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz
sudo tar -xzvf go1.13.3.linux-amd64.tar.gz -C /usr/local/
unset GOPATH
go get -d github.com/lightningnetwork/lnd
cd ~/go/src/github.com/lightningnetwork/lnd
git checkout v0.9.0-beta
make tags=invoicesrpc && make tags=invoicesrpc install
echo 'export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$HOME/go/bin:$PATH' >> $BASH_ENV
print_current_versions:
steps:
- run:
Expand All @@ -164,7 +122,7 @@ commands:
steps:
- restore_cache:
keys:
- rustup-{{ checksum "rust-toolchain" }}-nightly-2019-07-31
- rustup-{{ checksum "rust-toolchain" }}-nightly-2020-01-15
# We don't want multiple toolchains to pile up in our cache, so only restore the ones we actually use.
- restore_cache:
keys:
Expand All @@ -176,15 +134,13 @@ commands:
# We don't want the target folder to blow up over time, hence we only download the cache if it exactly matches `Cargo.lock`
- restore_cache:
keys:
- yarn-packages-v1-{{ .Branch }}-{{ checksum "api_tests/yarn.lock" }}
- yarn-packages-v1-{{ .Branch }}-
- yarn-packages-v1-
- yarn-packages-v1-{{ checksum "api_tests/yarn.lock" }}
save_caches:
steps:
- save_cache:
paths:
- ~/.rustup
key: rustup-{{ checksum "rust-toolchain" }}-nightly-2019-07-31
key: rustup-{{ checksum "rust-toolchain" }}-nightly-2020-01-15
- save_cache:
paths:
- ~/.cargo
Expand All @@ -197,4 +153,4 @@ commands:
paths:
- ~/.cache/yarn
- api_tests/node_modules
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "api_tests/yarn.lock" }}
key: yarn-packages-v1-{{ checksum "api_tests/yarn.lock" }}
16 changes: 1 addition & 15 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,12 @@ update_configs:
update_type: "all"
dependency_type: "direct"
ignored_updates:
# as per https://github.com/comit-network/comit-rs/issues/1316
- match:
dependency_name: "primitive-types"
- match:
dependency_name: "rlp"
# we only depend on ethbloom to access certain types. our version needs to match whichever version web3 is transitively bringing in
- match:
dependency_name: "ethbloom"
# we only depend on `libsqlite3-sys` directly to activate the "bundled" feature. the version we are using has to match the one that diesel is depending on, hence bumping it manually is pointless.
- match:
dependency_name: "libsqlite3-sys"
# this needs updating based on the libp2p version
- match:
dependency_name: "multistream-select"
# this needs updating based on the tokio_codec version
# this needs updating based on the futures_codec version
- match:
dependency_name: "bytes"
# until all our code is async/await ready, we cannot update tokio through dependabot
- match:
dependency_name: "tokio"
- package_manager: "javascript"
directory: "/api_tests"
update_schedule: "daily"
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Assign PR to creator

on: pull_request
on:
pull_request:
types: opened

jobs:
automation:
runs-on: ubuntu-latest
steps:
- name: Assign PR to creator
uses: thomaseizinger/[email protected]
if: github.event_name == 'pull_request' && github.event.action == 'opened'
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/cargo-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
77 changes: 77 additions & 0 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: "Draft new release"

on:
issues:
types: [opened, labeled]

jobs:
draft-new-release:
name: "Draft a new release"
runs-on: ubuntu-latest
# Only run for issues with a specific title and label. Not strictly required but makes finding the release issue again later easier.
# There is also a whitelist that you may want to use to restrict, who can trigger this workflow.
# Unfortunately, we cannot create an array on the fly, so the whitelist is just comma-separated.
if: startsWith(github.event.issue.title, 'Release version') && contains(github.event.issue.labels.*.name, 'release') && contains('thomaseizinger,bonomat,D4nte,da-kami,luckysori,tcharding,rishflab', github.event.issue.user.login)
steps:
- uses: actions/checkout@v2

- name: Extract version from issue title
run: |
TITLE="${{ github.event.issue.title }}"
VERSION=${TITLE#Release version }
echo "::set-env name=RELEASE_VERSION::$VERSION"
- name: Create release branch
run: git checkout -b release/${{ env.RELEASE_VERSION }}

- name: Update changelog
uses: thomaseizinger/[email protected]
with:
version: ${{ env.RELEASE_VERSION }}

- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email [email protected]
- name: Bump version in Cargo.toml
uses: thomaseizinger/[email protected]
with:
version: ${{ env.RELEASE_VERSION }}
manifest: cnd/Cargo.toml

- name: Update Cargo.lock
uses: actions-rs/cargo@v1
with:
command: update
args: --package cnd

- name: Commit changelog and manifest files
id: make-commit
run: |
git add CHANGELOG.md cnd/Cargo.toml Cargo.lock
git commit --message "Prepare release ${{ env.RELEASE_VERSION }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Push new branch
run: git push origin release/${{ env.RELEASE_VERSION }} --force

- name: Create pull request
uses: thomaseizinger/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
head: release/${{ env.RELEASE_VERSION }}
base: master
title: ${{ github.event.issue.title }}
reviewers: ${{ github.event.issue.user.login }} # By default, we request a review from the person who opened the issue. You can replace this with a static list of users.
# Write a nice message to the user.
# We are claiming things here based on the `publish-new-release.yml` workflow.
body: |
Hi @${{ github.event.issue.user.login }}!
This PR was created in response to this release issue: #${{ github.event.issue.number }}.
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.
Loading

0 comments on commit 27f8862

Please sign in to comment.