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

Commit

Permalink
Add github actions, remove travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ed255 committed Mar 26, 2020
1 parent b0f32e6 commit 6e8e98b
Show file tree
Hide file tree
Showing 3 changed files with 125 additions and 19 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Go

on:
pull_request:
branches: [ master ]

jobs:
build:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
flags: [ "", "-race" ]

steps:

- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- uses: actions/checkout@v2

- name: Test ${{ matrix.flags }}
run: |
cd go/iden3mobile
go get -v -t -d ./...
go test -v -count=1 ${{ matrix.flags }} ./...
96 changes: 96 additions & 0 deletions .github/workflows/gomobile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Gomobile

on:
push:
branches: [ master ]

jobs:
build:
name: Gomobile
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*

- name: Build
id: build
run: |
mkdir -p /tmp/builds
docker pull ed255/gomobile-android:latest
docker run \
--mount type=bind,source=$PWD,target=/root/iden3-mobile,readonly \
--mount type=bind,source=/tmp/builds,target=/builds \
ed255/gomobile-android:latest \
/bin/bash -c 'set -ex && \
cd /root/iden3-mobile/go/iden3mobile && \
mkdir /tmp/build && \
gomobile bind --target android -o /tmp/build/iden3mobile.aar && \
mv /tmp/build /builds/out'
echo "::set-output name=sha256_aar::$(sha256sum --tag iden3mobile.aar)"
echo "::set-output name=sha256_jar::$(sha256sum --tag iden3mobile-sources.jar)"
- name: Artifact aar
uses: actions/upload-artifact@v1
with:
name: iden3ombile.aar
path: /tmp/builds/out/iden3mobile.aar

- name: Artifact jar
uses: actions/upload-artifact@v1
with:
name: iden3mobile-sources.jar
path: /tmp/builds/out/iden3mobile-sources.jar

- name: Last Version
id: last_version
run: |
echo ::set-output name=version::$(git tag --list 'v*' | sort --version-sort | tail -n 1 | cut -c2-)
- name: Bump Version
id: bump_version
uses: christian-draeger/[email protected]
with:
current-version: ${{ steps.last_version.outputs.version }}
version-fragment: beta

- name: Next Version
id: next_version
run: |
echo ::set-output name=version::v${{ steps.bump_version.outputs.next-version }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.next_version.outputs.version }}
release_name: Release ${{ steps.next_version.outputs.version }} ${{ github.ref }}
body: |
${{ steps.build.outputs.sha256_aar }}
${{ steps.build.outputs.sha256_jar }}
draft: false
prerelease: true

- name: Release aar
id: release-aar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/builds/out/iden3mobile.aar
asset_name: iden3mobile.aar
asset_content_type: application/zip

- name: Release jar
id: release-jar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /tmp/builds/out/iden3mobile-sources.jar
asset_name: iden3mobile-sources.jar
asset_content_type: application/zip
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

0 comments on commit 6e8e98b

Please sign in to comment.