2022-10-03 13:18:01 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
name: test-and-build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- stable
|
2022-11-02 21:38:14 +00:00
|
|
|
tags:
|
|
|
|
- 'v*'
|
2022-10-03 13:18:01 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-and-build:
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
container:
|
|
|
|
image: luzifer/archlinux
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOPATH: /go
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Enable custom AUR package repo
|
2023-06-09 17:47:31 +00:00
|
|
|
run: echo -e "[luzifer]\nSigLevel = Never\nServer = https://archrepo.hub.luzifer.io/\$arch" >>/etc/pacman.conf
|
2022-10-03 13:18:01 +00:00
|
|
|
|
|
|
|
- name: Install required packages
|
|
|
|
run: |
|
|
|
|
pacman -Syy --noconfirm \
|
|
|
|
awk \
|
|
|
|
curl \
|
|
|
|
diffutils \
|
|
|
|
git \
|
2023-12-15 12:55:46 +00:00
|
|
|
git-lfs \
|
2022-10-03 13:18:01 +00:00
|
|
|
go \
|
|
|
|
golangci-lint-bin \
|
|
|
|
make \
|
2023-07-01 16:02:32 +00:00
|
|
|
nodejs-lts-hydrogen \
|
2022-10-03 13:18:01 +00:00
|
|
|
npm \
|
|
|
|
tar \
|
2023-06-12 21:35:54 +00:00
|
|
|
trivy \
|
2022-10-03 13:18:01 +00:00
|
|
|
unzip \
|
|
|
|
which \
|
|
|
|
zip
|
|
|
|
|
2023-12-15 12:55:46 +00:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
lfs: true
|
|
|
|
show-progress: false
|
2022-10-03 13:18:01 +00:00
|
|
|
|
2023-12-20 19:59:21 +00:00
|
|
|
- name: Marking workdir safe
|
2023-12-15 12:55:46 +00:00
|
|
|
run: |
|
|
|
|
git config --global --add safe.directory /__w/twitch-bot/twitch-bot
|
2022-10-03 13:18:01 +00:00
|
|
|
|
|
|
|
- name: Lint and test code
|
2023-03-24 22:26:10 +00:00
|
|
|
run: make lint test frontend_lint
|
2022-10-03 13:18:01 +00:00
|
|
|
|
|
|
|
- name: Build release
|
|
|
|
run: make publish
|
|
|
|
|
2023-06-12 21:35:54 +00:00
|
|
|
- name: Execute Trivy scan
|
|
|
|
run: make trivy
|
|
|
|
|
2022-10-03 13:18:01 +00:00
|
|
|
- name: Extract changelog
|
|
|
|
run: 'awk "/^#/ && ++c==2{exit}; /^#/f" "History.md" | tail -n +2 >release_changelog.md'
|
|
|
|
|
|
|
|
- name: Update stable branch
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
run: |
|
2022-11-02 22:10:08 +00:00
|
|
|
git branch -f stable ${GITHUB_SHA}
|
|
|
|
git push -f origin stable
|
2022-10-03 13:18:01 +00:00
|
|
|
|
|
|
|
- name: Release
|
2023-06-24 20:26:42 +00:00
|
|
|
uses: ncipollo/release-action@v1
|
2022-10-03 13:18:01 +00:00
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
2023-06-24 20:26:42 +00:00
|
|
|
artifacts: '.build/*'
|
|
|
|
bodyFile: release_changelog.md
|
2022-10-03 13:18:01 +00:00
|
|
|
draft: false
|
2023-06-24 20:26:42 +00:00
|
|
|
generateReleaseNotes: false
|
2022-10-03 13:18:01 +00:00
|
|
|
|
|
|
|
...
|