GitHub workflow for releases (#368)

* GitHub workflow for releases

* avoid renaming

* add workflow for tests

* fix workflow name

* one yaml for all

* fix yaml

* add missing pipe

* add conditional

* also rename that other var

* remove empty version

* print the go version

* add name to step

* add go version when building

* split files

* remove dependency

* delete travis and add badge

* CHANGE NAMES TO LOWER CASE
This commit is contained in:
Federico Marzocchi 2021-05-01 19:53:15 +02:00 committed by GitHub
parent 941ec1fe0f
commit 16e94447f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 87 additions and 51 deletions

View file

@ -1,4 +1,4 @@
name: Deploy multi-architecture Docker images for transfer.sh with buildx
name: deploy multi-architecture Docker images for transfer.sh with buildx
on:
schedule:

58
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,58 @@
name: release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
GOOS: [ darwin, linux, windows ]
GOARCH: [ amd64 ]
include:
- GOOS: darwin
GOARCH: amd64
suffix: darwin-amd64
- GOOS: windows
GOARCH: amd64
suffix: windows-amd64.exe
- GOOS: linux
GOARCH: amd64
suffix: linux-amd64
- GOOS: linux
GOARCH: arm
suffix: linux-armv7
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16.x
- name: Build ${{ matrix.suffix }} (GOOS=${{ matrix.GOOS }}, GOARCH=${{ matrix.GOARCH }})
env:
GOOS: ${{ matrix.GOOS }}
GOARCH: ${{ matrix.GOARCH }}
run: |
go version
go build -o ./artifacts/transfersh-${GITHUB_REF##*/}-${{ matrix.suffix }}
- uses: actions/upload-artifact@v2
name: Upload artifacts
with:
name: artifacts
path: ./artifacts
release:
runs-on: ubuntu-latest
needs: [ build ]
steps:
- uses: actions/download-artifact@v2
name: Download artifacts
with:
name: artifacts
path: ./artifacts
- name: Publish artifacts
uses: softprops/action-gh-release@v1
with:
files: './artifacts/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

27
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,27 @@
name: test
on:
push:
branches:
- "*"
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go_version:
- 1.13.x
- 1.14.x
- 1.15.x
- 1.16.x
name: Test with ${{ matrix.go_version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go_version }}
- name: Vet and test
run: |
go version
go vet ./...
go test ./...

View file

@ -1,49 +0,0 @@
language: go
sudo: false
os:
- linux
services:
- docker
go:
- 1.13.x
- 1.14.x
- 1.15.x
- 1.16.x
- tip
env:
global:
- GO111MODULE=on
install:
- go get -t -u -v ./...
- go build -v .
- go vet ./...
script:
- go test ./...
before_deploy:
- mkdir -p release
- "GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags netgo -ldflags '-a -s -w -extldflags -static' -o release/transfersh-$TRAVIS_TAG-linux-amd64"
- "GOOS=linux GOARCH=arm GOARM=7 CGO_ENABLED=0 go build -tags netgo -ldflags '-a -s -w -extldflags -static' -o release/transfersh-$TRAVIS_TAG-linux-armv7"
- "GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -tags netgo -ldflags '-a -s -w -extldflags -static' -o release/transfersh-$TRAVIS_TAG-darwin-amd64"
- "GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -tags netgo -ldflags '-a -s -w -extldflags -static' -o release/transfersh-$TRAVIS_TAG-win-amd64.exe"
deploy:
provider: releases
api_key:
secure: cOuMGyvrl/9GX3TZFL+Vq++2Bv5Hlb3VfXSYONfeAj+1AXI3Y+tPruy/XnWpa1MUxkvFuIhea3sUAiKfwhHip9csCmMUhDJtaTU9apsxRkyF/OFrWb7/FlbnqYuAwnp91ImvtSlnubg2VHTjhBA6ycNQF7WZcJEMVMsAtC/nSY4=
file:
- "release/transfersh-$TRAVIS_TAG-linux-amd64"
- "release/transfersh-$TRAVIS_TAG-linux-armv7"
- "release/transfersh-$TRAVIS_TAG-darwin-amd64"
- "release/transfersh-$TRAVIS_TAG-win-amd64.exe"
skip_cleanup: true
on:
tags: true
go: 1.15.x
overwrite: true

View file

@ -1,4 +1,4 @@
# transfer.sh [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dutchcoders/transfer.sh?utm_source=badge&utm_medium=badge&utm_campaign=&utm_campaign=pr-badge&utm_content=badge) [![Go Report Card](https://goreportcard.com/badge/github.com/dutchcoders/transfer.sh)](https://goreportcard.com/report/github.com/dutchcoders/transfer.sh) [![Docker pulls](https://img.shields.io/docker/pulls/dutchcoders/transfer.sh.svg)](https://hub.docker.com/r/dutchcoders/transfer.sh/) [![Build Status](https://travis-ci.com/dutchcoders/transfer.sh.svg?branch=master)](https://travis-ci.com/dutchcoders/transfer.sh)
# transfer.sh [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dutchcoders/transfer.sh?utm_source=badge&utm_medium=badge&utm_campaign=&utm_campaign=pr-badge&utm_content=badge) [![Go Report Card](https://goreportcard.com/badge/github.com/dutchcoders/transfer.sh)](https://goreportcard.com/report/github.com/dutchcoders/transfer.sh) [![Docker pulls](https://img.shields.io/docker/pulls/dutchcoders/transfer.sh.svg)](https://hub.docker.com/r/dutchcoders/transfer.sh/) [![Build Status](https://github.com/dutchcoders/transfer.sh/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/dutchcoders/transfer.sh/actions/workflows/test.yml?query=branch%3Amaster)
Easy and fast file sharing from the command-line. This code contains the server with everything you need to create your own instance.