Skip to content

Commit

Permalink
Add releases to circleci (#1277)
Browse files Browse the repository at this point in the history
* Add releases

* wip

* fix

* Fix deps

* Fix

* wip

* Fix version extract

* Zip and rename binary with version

* more cleaning

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Update config.yml

* Add staging branch
  • Loading branch information
adamdossa committed Aug 11, 2022
1 parent 6aa46e3 commit eb724ba
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ jobs:
root: ./target/release
paths:
- polymesh
- run:
name: Create assets directory for releases
command: mkdir ./assets
- run:
name: Copy binary to assets
command: cp ./target/release/polymesh ./assets/polymesh
- run:
name: Copy wasm to assets
command: cp ./target/release/wbuild/polymesh*/*wasm ./assets/
- run:
name: List files
command: ls -ltra
- persist_to_workspace:
root: ./assets
paths:
- .
- save_cache:
key: v6-release-cache-{{ checksum "./rust.version" }}-{{ checksum "./Cargo.lock" }}
paths:
Expand Down Expand Up @@ -293,6 +309,22 @@ jobs:
--tag $IMAGE_NAME:alpine-$NIGHTLY .
echo $DOCKERHUB_PASS | docker login -u $DOCKERHUB_USERNAME --password-stdin
docker push $IMAGE_NAME
publish-github-release:
docker:
- image: circleci/golang:1.16
steps:
- attach_workspace:
at: ./assets
- run:
name: "Publish Release on GitHub"
command: |
go get github.com/tcnksm/ghr
cd assets
VERSION=$(./polymesh --version | cut -d" " -f2)
mv ./polymesh ./polymesh-${VERSION}
zip -rm ./polymesh-${VERSION}.zip ./polymesh-${VERSION}
zip -rm ./polymesh-${VERSION}-wasm.zip ./*.wasm
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -prerelease -delete ${VERSION} ./
workflows:
version: 2
Expand Down Expand Up @@ -341,3 +373,12 @@ workflows:
- testnet
- staging
- develop
- publish-github-release:
requires:
- build
filters:
branches:
only:
- mainnet
- testnet
- staging

0 comments on commit eb724ba

Please sign in to comment.