Skip to content

Scan

Scan #2

Workflow file for this run

name: Scan
on:
schedule:
- cron: '0 1 1 * *'
workflow_dispatch:
# workflow_run:
# workflows: ["Build"]
# branches: [main]
# types:
# - completed
jobs:
scan:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'failure' }}
steps:
- name: Download artifact
# inspired by https://github.com/marketplace/actions/download-workflow-artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: Build.yml
name: OoliteAddonScanner
- name: Install AddonScanner
run: |
unzip OoliteAddonScanner-*-executable.zip
- name: get date
run: |
echo "TODAY=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Restore expansions cache
id: cache-restore
uses: actions/cache/restore@v3
with:
path: |
expansion-cache
key: ${{ runner.os }}-expansion_cache
- name: Run AddonScanner
run: |
B=$(basename "OoliteAddonScanner*")
java -jar $B/$B.jar --out target/OoliteExpansionIndex --cache expansion-cache
echo "running compgen..."
man compgen
compgen -f target/OoliteExpansionIndex-*.zip
- name: Remove old OoliteExpansionIndex releases
if: github.ref == 'refs/heads/main'
uses: s00d/[email protected]
with:
#repo: <owner>/<repoName> # defaults to current repo
keep_latest: 12
delete_tag_pattern: idx-
delete_type: 'release'
target_branch: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "idx-${{ env.TODAY }}"
prerelease: false
title: "OoliteExpansionIndex ${{ env.TODAY }}"
files: |
target/OoliteExpansionIndex-*.zip
- name: Save Expansions Cache
id: cache-save
uses: actions/cache/save@v3
with:
path: |
expansion-cache
key: ${{ runner.os }}-expansion_cache