Skip to content

Commit

Permalink
Create test-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtvignoli authored Aug 20, 2024
1 parent 3713237 commit f47caec
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: "Build plugin"

on:
push:
branches: ['main']
paths:
- 'plugin/**'
- '.github/**'

jobs:
build-and-push-image:
if: ${{ !contains(github.event.head_commit.message, '#skip-actions') }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
defaults:
run:
working-directory: plugin
environment: production

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# - name: Lint
# run: |
# pylint $(git ls-files '*.py') --fail-under=10


- name: Get version
id: metadata
run: |
version=$(grep "^VERSION" config.py | cut -d'=' -f2- | cut -d"'" -f2 )
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Package
run: |
pyinstaller -F --path venv/lib64/python3.10/site-packages kubectl-swissknife.py
# - uses: actions/upload-artifact@v4
# with:
# name: "kubectl-swissknife-${{ steps.metadata.outputs.version }}"
# path: "${{ github.workspace }}/plugin/dist/kubectl-swissknife"

- name: Release with Notes
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.metadata.outputs.version }}
files: ${{ github.workspace }}/plugin/dist/kubectl-swissknife
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

0 comments on commit f47caec

Please sign in to comment.