Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move from travis to github actions #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/.workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
tags:
- 'Vault/*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
AZURE_STORAGE_CONTAINER: dist

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
debian-x64:
name: debian-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./Build/CI/build.sh
env:
RID: debian-x64
PGP_KEY: ${{ secrets.PGP_KEY }}
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
linux-x64:
name: linux-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./Build/CI/build.sh
env:
RID: linux-x64
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
osx-x64:
name: osx-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./Build/CI/build.sh
env:
RID: osx-x64
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
win-x64:
name: win-x64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./Build/CI/build.sh
env:
RID: win-x64
WINDOWS_CERT: ${{ secrets.WINDOWS_CERT }}
WINDOWS_CERT_PASSWORD: ${{ secrets.WINDOWS_CERT_PASSWORD }}
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}


File renamed without changes.
File renamed without changes.
32 changes: 12 additions & 20 deletions Build/travis/build.sh → Build/CI/build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
set -e

DOCKER_IMAGE_NAME="vault-$RID"
DOCKER_BUILD_ARGS=""
if [[ "$PGP_KEY" ]]; then
DOCKER_BUILD_ARGS="--build-arg "PGP_KEY=$PGP_KEY""
fi
if [[ "$WINDOWS_CERT" ]]; then
DOCKER_BUILD_ARGS="$DOCKER_BUILD_ARGS --build-arg "WINDOWS_CERT=$WINDOWS_CERT" --build-arg "WINDOWS_CERT_PASSWORD=$WINDOWS_CERT_PASSWORD""
fi

docker build -t "$DOCKER_IMAGE_NAME" $DOCKER_BUILD_ARGS -f "Build/$RID/Dockerfile" .
docker run --rm -v "$(pwd)/dist:/opt/dist" "$DOCKER_IMAGE_NAME"

if [[ "$TRAVIS_TAG" ]]; then
travis_version="$(echo "$TRAVIS_TAG" | cut -d'/' -f2)"
if [[ "$GITHUB_REF_NAME" ]]; then
ci_version="$(echo "$GITHUB_REF_NAME" | cut -d'/' -f2)"
csproj_version="v$(cat BTCPayServer.Vault/Version.csproj | sed -n 's/.*<Version>\(.*\)<\/Version>.*/\1/p')"
if [[ "$travis_version" != "$csproj_version" ]]; then
echo "The tagged version on travis ($travis_version) is different from the csproj ($csproj_version)"
if [[ "$ci_version" != "$csproj_version" ]]; then
echo "The tagged version on travis ($ci_version) is different from the csproj ($csproj_version)"
exit 1
fi
fi
Expand All @@ -21,22 +29,6 @@ if ! [[ "$AZURE_STORAGE_CONNECTION_STRING" ]] || ! [[ "$AZURE_STORAGE_CONTAINER"
fi
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az storage container create --name "$AZURE_STORAGE_CONTAINER" --public-access "container"
sudo apt-get install -y ccrypt

sudo touch dist/secrets
sudo chmod 777 dist/secrets
echo "APPLE_DEV_ID_CERT='$APPLE_DEV_ID_CERT'" >> dist/secrets
echo "APPLE_DEV_ID_CERT_PASSWORD='$APPLE_DEV_ID_CERT_PASSWORD'" >> dist/secrets
echo "APPLE_ID='$APPLE_ID'" >> dist/secrets
echo "APPLE_ID_PASSWORD='$APPLE_ID_PASSWORD'" >> dist/secrets
echo "AZURE_STORAGE_CONNECTION_STRING='$AZURE_STORAGE_CONNECTION_STRING'" >> dist/secrets
echo "AZURE_STORAGE_CONTAINER='$AZURE_STORAGE_CONTAINER'" >> dist/secrets
echo "GITHUB_TOKEN='$GITHUB_TOKEN'" >> dist/secrets
echo "PGP_KEY='$PGP_KEY'" >> dist/secrets
echo "WINDOWS_CERT='$WINDOWS_CERT'" >> dist/secrets
echo "WINDOWS_CERT_PASSWORD='$WINDOWS_CERT_PASSWORD'" >> dist/secrets

sudo ccencrypt dist/secrets -K $ENC_KEY

for file in dist/*; do
BLOB_NAME="dist-$TRAVIS_BUILD_ID/$(basename -- $file)"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.