CI #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 1 * *' | |
workflow_dispatch: | |
permissions: | |
actions: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:20.04 | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
steps: | |
- name: Install necessary tools | |
run: | | |
apt update | |
apt install -y git subversion curl make gcc g++ autoconf file appstream libssl-dev | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Patch repository permissions # Else the repository will be owned by another user and git will complain | |
run: chown -R root:root . | |
- name: Run build script | |
run: ./build.sh | |
- name: Upload AppImage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nmap AppImage | |
path: | | |
*.AppImage | |
*.AppImage.zsync | |
- name: Get last github release version | |
id: last_version | |
uses: pozetroninc/[email protected] | |
with: | |
repository: ${{ github.repository }} | |
- name: Get nmap release version | |
run: echo "NMAP_VERSION=`cat NMAP_VERSION`" >> $GITHUB_ENV | |
- name: Print both versions | |
run: | | |
echo "Latest release is ${{ steps.last_version.outputs.release }}" | |
echo "Build version is ${{ env.NMAP_VERSION }}" | |
- name: Create release if new nmap version | |
if: "${{ env.NMAP_VERSION != steps.last_version.outputs.release }}" | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "*.AppImage,*.AppImage.zsync" | |
tag: ${{env.NMAP_VERSION}} | |
- name: Create a dummy commit to keep the repository active | |
uses: gautamkrishnar/keepalive-workflow@v2 |