From efd29741eb450698c970797c3b2d6dd33010eb3c Mon Sep 17 00:00:00 2001 From: ptrvsrg Date: Sun, 16 Jun 2024 02:48:53 +0700 Subject: [PATCH] Add CI --- .github/workflows/build_python.yml | 26 ++++++++++++++++++++++++++ .github/workflows/create_release.yml | 24 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/build_python.yml create mode 100644 .github/workflows/create_release.yml diff --git a/.github/workflows/build_python.yml b/.github/workflows/build_python.yml new file mode 100644 index 0000000..d5f1897 --- /dev/null +++ b/.github/workflows/build_python.yml @@ -0,0 +1,26 @@ +name: Build Python application +on: + push: + pull_request: + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Cache pip dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi \ No newline at end of file diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml new file mode 100644 index 0000000..c34de54 --- /dev/null +++ b/.github/workflows/create_release.yml @@ -0,0 +1,24 @@ +name: Create Release +on: + push: + tags: + - '*' +jobs: + release: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + Release created automatically by Github Action + draft: false + prerelease: false \ No newline at end of file