Skip to content

Commit

Permalink
BREAKING CHANGE: use a specific xud-docker branch to launch
Browse files Browse the repository at this point in the history
This commit enables the binary launcher to use a specific xud-docker
branch to setup the whole environment. It's related to
ExchangeUnion/xud-docker#836. It will download xud-docker launcher
binary file into ~/.xud-docker/launcher/versions/<commit> and delegate
all CLI commands to xud-docker launcher.
  • Loading branch information
reliveyy committed Jan 11, 2021
1 parent 9d55c5e commit 8215618
Show file tree
Hide file tree
Showing 32 changed files with 646 additions and 2,665 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/artifacts.yaml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

on:
push:
tags:
- v*

jobs:
create_release:
name: Create a release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
prerelease: true
draft: true

build:
needs: create_release
name: Build artifacts
strategy:
matrix:
platform: [ ubuntu-latest ]
go-version: [ 1.15.x ]
os: [ linux, darwin, windows ]
arch: [ amd64 ]

runs-on: ${{ matrix.platform }}

steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}

- name: Checkout
uses: actions/checkout@v2

- name: Fetch dependencies
run: go mod vendor

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

- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
make VERSION=${{ steps.get_version.outputs.VERSION }} build
make zip
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-${{ matrix.architecture }}
path: |
xud-launcher
xud-launcher.exe
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: xud-launcher.zip
asset_name: xud-launcher-${{ matrix.os }}-${{ matrix.arch }}.zip
asset_content_type: application/zip
22 changes: 16 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,36 @@ GO_BIN := ${GOPATH}/bin

GOBUILD := go build -v

VERSION := v1.0.0
VERSION := local
COMMIT := $(shell git rev-parse HEAD)
ifeq ($(OS),Windows_NT)
TIMESTAMP := $(shell powershell.exe scripts\get_timestamp.ps1)
else
TIMESTAMP := $(shell date +%s)
endif

ifeq ($(GOOS), windows)
OUTPUT := xud-launcher.exe
else
OUTPUT := xud-launcher
endif


LDFLAGS := -ldflags "-w -s \
-X $(PKG)/build.Version=$(VERSION) \
-X $(PKG)/build.GitCommit=$(COMMIT) \
-X $(PKG)/build.Timestamp=$(TIMESTAMP)"

default: build


#
# Building
#

build:
$(GOBUILD) $(LDFLAGS)

zip:
zip --junk-paths xud-launcher.zip $(OUTPUT)

clean:
rm -f xud-launcher
rm -f xud-launcher.zip

.PHONY: build
24 changes: 0 additions & 24 deletions cmd/attach.go

This file was deleted.

133 changes: 0 additions & 133 deletions cmd/cleanup.go

This file was deleted.

Loading

0 comments on commit 8215618

Please sign in to comment.