2020-06-01 16:17:02 +02:00
|
|
|
name: ci
|
2020-11-18 17:42:00 +01:00
|
|
|
|
2020-06-01 16:14:03 +02:00
|
|
|
on:
|
|
|
|
push:
|
2022-02-26 13:57:27 +01:00
|
|
|
branches: [ main ]
|
2020-06-01 16:14:03 +02:00
|
|
|
pull_request:
|
2022-02-26 13:57:27 +01:00
|
|
|
branches: [ main ]
|
2020-06-01 16:14:03 +02:00
|
|
|
|
2020-11-18 17:40:05 +01:00
|
|
|
|
2020-06-01 16:14:03 +02:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Set up Go 1.x
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ^1.13
|
|
|
|
id: go
|
|
|
|
|
|
|
|
- name: Check out code into the Go module directory
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Get dependencies
|
|
|
|
run: |
|
|
|
|
go get -v -t -d ./...
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build -v .
|
|
|
|
|
|
|
|
- name: Test
|
|
|
|
run: go test -v .
|
2020-11-18 16:49:23 +01:00
|
|
|
|
|
|
|
release:
|
2022-02-26 13:57:27 +01:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
2020-11-18 16:50:40 +01:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-18 16:49:23 +01:00
|
|
|
needs: build
|
2020-11-18 16:50:06 +01:00
|
|
|
steps:
|
2020-11-18 16:49:23 +01:00
|
|
|
|
2020-11-18 17:45:55 +01:00
|
|
|
- name: Set outputs
|
2020-11-18 17:42:00 +01:00
|
|
|
id: vars
|
2020-11-18 17:49:27 +01:00
|
|
|
run: echo "::set-output name=sha_short::$(echo ${{ github.sha }} | cut -c1-4)"
|
2020-11-18 17:42:00 +01:00
|
|
|
|
2020-11-18 17:21:14 +01:00
|
|
|
- name: announce update
|
|
|
|
run: |
|
2021-03-19 22:43:17 +01:00
|
|
|
echo -en "PASS ${{ secrets.TMI_TOKEN }}\r\nNICK gempbot\r\nPRIVMSG #pajlada :nymnREACT $(echo '${{ github.event.head_commit.message }}' | tr '\n' ' ' | cut -c -200) github.com/gempir/justlog/commit/${{ steps.vars.outputs.sha_short }} | justlog update\r\n" | openssl s_client -connect irc.chat.twitch.tv:6697
|