-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from netfoundry/inital-code
Initial code
- Loading branch information
Showing
9 changed files
with
1,024 additions
and
1 deletion.
There are no files selected for viewing
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
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 |
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
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 |
Oops, something went wrong.