diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d862228 --- /dev/null +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9a27a8f --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/gosum.yml b/.github/workflows/gosum.yml new file mode 100644 index 0000000..d11e40f --- /dev/null +++ b/.github/workflows/gosum.yml @@ -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 diff --git a/.github/workflows/released.yml b/.github/workflows/released.yml new file mode 100644 index 0000000..b95e3c2 --- /dev/null +++ b/.github/workflows/released.yml @@ -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