fix(workflow): Force installlation on the build workflow via installe… #18
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: Build and Publish Debian Package | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deb: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y dpkg-dev wget | |
- name: Build the deb package | |
run: | | |
# Build the deb package | |
sudo dpkg-deb -b kali-anonsurf-deb-src/ kali-anonsurf.deb | |
- name: Run the installer | |
run : | | |
sudo chmod +x ./installer.sh | |
sudo ./installer.sh | |
- name: Get version from control file | |
run: | | |
VERSION=$(grep '^Version:' kali-anonsurf-deb-src/DEBIAN/control | cut -d' ' -f2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Set up GitHub context | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Create and publish release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
VERSION="${{ env.VERSION }}" | |
RELEASE_NAME="kali-anonsurf-$VERSION" | |
TAG_NAME="v$VERSION" | |
echo "Creating release: $RELEASE_NAME (tag: $TAG_NAME)" | |
gh release create "$TAG_NAME" -t "$RELEASE_NAME" -n "Release for version $VERSION" kali-anonsurf.deb | |
notify-release: | |
needs: build-deb | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Get version from control file | |
run: | | |
VERSION=$(grep '^Version:' kali-anonsurf-deb-src/DEBIAN/control | cut -d' ' -f2) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Call Webhook | |
run: | | |
VERSION="${{ env.VERSION }}" | |
curl -X POST \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"text": "Published [Kali-anonsurf $VERSION](https://github.com/Und3rf10w/kali-anonsurf/releases/tag/$VERSION)!\n", | |
"format": "markdown", "displayName": "Github Actions - Kali-anonsurf" | |
}' \ | |
${{ secrets.WEBHOOK_URL }} |