Skip to content

Commit

Permalink
Merge pull request #1 from netfoundry/inital-code
Browse files Browse the repository at this point in the history
Initial code
  • Loading branch information
dariuszSki authored Jun 30, 2023
2 parents 1124d2a + d3e5bc1 commit 67ce47a
Show file tree
Hide file tree
Showing 9 changed files with 1,024 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: ci

on: [push]

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
goos: [linux]
goarch: [amd64]
steps:
- name: check out code
uses: actions/checkout@v3

- name: install updates and python packages
run: |
sudo apt-get update -qq
sudo apt-get upgrade -yqq
sudo apt-get install -y python3-pip
pip install pylint
- name: verify code to confirm to python
run: |
pylint --rcfile .pylintrc src/*
- name: tar python package for release
run: |
mkdir erhchecker
cp src/* erhchecker/
python3 -m pip install -r files/requirements.txt --target erhchecker --upgrade
python3 -m zipapp -p "/usr/bin/python3" --compress --output erhchecker.pyz erhchecker
tar -cvzf erhchecker_${{matrix.goos}}_${{matrix.goarch}}.tar.gz erhchecker.pyz
- name: upload a built artifact for testing
if: startsWith(github.ref, 'refs/heads/main') == false
uses: actions/upload-artifact@v3
with:
name: erhchecker_${{matrix.goos}}_${{matrix.goarch}}
path: erhchecker_${{matrix.goos}}_${{matrix.goarch}}.tar.gz
retention-days: 5
58 changes: 58 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: release

on:
pull_request:
types: [closed]

jobs:
build_release:
runs-on: ubuntu-22.04
strategy:
matrix:
goos: [linux]
goarch: [amd64]

steps:
- name: check out code
uses: actions/checkout@v3

- name: install updates and python packages
run: |
sudo apt-get update -qq
sudo apt-get upgrade -yqq
sudo apt-get install -y python3-pip
- name: zip python package for release
run: |
mkdir erhchecker
cp src/* erhchecker/
python3 -m pip install -r files/requirements.txt --target erhchecker --upgrade
python3 -m zipapp -p "/usr/bin/python3" --compress --output erhchecker.pyz erhchecker
tar -cvzf erhchecker_${{matrix.goos}}_${{matrix.goarch}}.gz erhchecker.pyz
- name: get version
id: version
run: |
echo "version=$(./erhchecker.pyz -v)" >> $GITHUB_ENV
- name: release
uses: actions/create-release@v1
id: release
with:
draft: false
prerelease: false
release_name: v${{ env.version }}
tag_name: v${{ env.version }}
env:
GITHUB_TOKEN: ${{ github.token }}

- name: upload artifact for release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: erhchecker_${{matrix.goos}}_${{matrix.goarch}}.tar.gz
asset_name: erhchecker_${{matrix.goos}}_${{matrix.goarch}}.tar.gz
asset_content_type: application/gzip
Loading

0 comments on commit 67ce47a

Please sign in to comment.