mirror of
https://github.com/nielsAD/autoindex.git
synced 2026-01-19 11:52:04 +01:00
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
name: Build
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
name: ${{ matrix.os }}, go${{ matrix.go }}
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
go: [1.17]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
steps:
|
|
- name: Checkout repository and submodules
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Go ${{ matrix.go }}
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Test
|
|
run: go test ./...
|
|
|
|
- name: Build
|
|
run: go build
|
|
|
|
- name: Prepare artifacts
|
|
run: |
|
|
REF_NAME=$(echo "${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}" | sed 's/[^a-zA-Z0-9\-_.]/-/g')
|
|
echo "ref_name=$REF_NAME" >> $GITHUB_ENV
|
|
echo -e "Author: Niels A.D.
|
|
Project: autoindex (https://github.com/nielsAD/autoindex)
|
|
Platform: `go env GOOS`/`go env GOARCH` (`go env GOVERSION`)
|
|
Release: $REF_NAME ($GITHUB_SHA)
|
|
Date: `date -u`" > VERSION.txt
|
|
mv autoindex.exe autoindex-$REF_NAME.exe || true
|
|
mv autoindex autoindex-$REF_NAME || true
|
|
mv LICENSE LICENSE.txt
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: autoindex_${{ env.ref_name }}_${{ runner.os }}
|
|
path: |
|
|
public/
|
|
autoindex-*
|
|
LICENSE.txt
|
|
VERSION.txt
|