dumping CORS #9
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: python | |
on: | |
push: | |
branches: [master] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
pytest: | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- run: pip install pytest pytest-cov -r requirements.txt | |
- run: pytest --cov=webssh | |
build: | |
runs-on: ubuntu-latest | |
needs: | |
- pytest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: build | |
run: | | |
pip install pyinstaller -r requirements.txt | |
./build.sh | |
./dist/run --help | |
mv ./dist/run ./dist/wssh | |
./dist/wssh --help | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wssh | |
path: ./dist/wssh | |
if-no-files-found: error | |
retention-days: 1 | |
release: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: login to registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: add build hash to env | |
shell: bash | |
run: echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wssh | |
- name: release | |
id: release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ env.sha_short }} | |
artifacts: "wssh" | |
makeLatest: true |