Skip to content

Commit

Permalink
Add workflows and dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Dec 27, 2020
1 parent 128e2a8 commit d2f97e5
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
timezone: "Europe/Paris"
labels:
- ":game_die: dependencies"
- ":robot: bot"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
timezone: "Europe/Paris"
labels:
- ":game_die: dependencies"
- ":robot: bot"
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: build

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
build:
runs-on: windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
-
name: Config
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
echo "$(go env GOPATH)/bin/windows_386" >> $GITHUB_PATH
echo "PORTAPPS_VERSION=$(cat go.mod | grep github.com/portapps/portapps | awk '{print $NF}')" >> $GITHUB_ENV
echo "PORTAPPS_DIR=./.portapps" >> $GITHUB_ENV
if [[ $GITHUB_REF == refs/tags/* ]]; then
echo "GIT_TAGNAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
shell: bash
-
name: Checkout core
uses: actions/checkout@v2
with:
repository: portapps/portapps
ref: ${{ env.PORTAPPS_VERSION }}
path: ${{ env.PORTAPPS_DIR }}
-
name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Build
run: |
ant release -Dcore.dir=${{ env.PORTAPPS_DIR }}
shell: bash
-
name: Upload assets
uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}
path: bin/release/*
-
name: GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
bin/release/*
name: ${{ env.GIT_TAGNAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v1
44 changes: 44 additions & 0 deletions .github/workflows/gosum.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: gosum

on:
push:
branches:
- 'master'
paths:
- '.github/workflows/gosum.yml'
- 'go.mod'
- 'go.sum'

jobs:
fix:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.13
-
name: Tidy
run: |
rm -f go.sum
go mod tidy
-
name: Set up Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name GitHub
git config user.email noreply@github.com
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
-
name: Commit and push changes
run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit --author "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" --message "Fix go modules"
git push
fi
35 changes: 35 additions & 0 deletions .github/workflows/released.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: released

on:
release:
types: [published]

jobs:
virustotal:
runs-on: ubuntu-latest
steps:
-
name: Prepare
id: prepare
run: |
echo ::set-output name=date::$(date -u +'%Y%m%d')
-
name: VirusTotal Monitor Scan
uses: crazy-max/ghaction-virustotal@v2
with:
vt_api_key: ${{ secrets.VT_MONITOR_API_KEY }}
vt_monitor: true
monitor_path: /portapps/${{ steps.prepare.outputs.date }}/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}
update_release_body: false
github_token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ github.event.repository.name }}-(win32|win64).exe
-
name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@v2
with:
vt_api_key: ${{ secrets.VT_API_KEY }}
update_release_body: true
github_token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ github.event.repository.name }}-(win32|win64).exe

0 comments on commit d2f97e5

Please sign in to comment.