From fded3f2b63cc61cc7223b2c355e0f91e299a9188 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Sat, 6 Apr 2024 18:02:11 +0200 Subject: [PATCH] Upload release assets to releases --- .github/workflows/main.yml | 34 ++++------------------------------ .github/workflows/release.yml | 25 +++++++++++++++++++++++++ devenv.nix | 4 ++-- 3 files changed, 31 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a075b71..5593555 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,38 +8,12 @@ on: jobs: build: runs-on: ubuntu-latest - # container: quay.io/pypa/manylinux_2_28_x86_64 steps: - name: Checkout code uses: actions/checkout@v4 - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: '3.11.8' - - # - name: Install Nix - # uses: cachix/install-nix-action@v26 - - # - name: Install Cachix - # uses: cachix/cachix-action@v14 - # with: - # name: devenv - - # - name: Install devenv.sh - # run: nix profile install nixpkgs#devenv - - # - name: Build the devenv shell and run any pre-commit hooks - # run: devenv test - - - name: Build linux image - run: docker run --rm -v "${PWD}:/src/" --env SPECFILE=./schwifty.spec batonogov/pyinstaller-linux - - - name: Test linux image - run: dist/schwifty "DE89370400440532013000" - - # - name: Build devcontainer image - # uses: devcontainers/ci@v0.3 - # with: - # runCmd: devenv test \ No newline at end of file + - name: Build devcontainer image + uses: devcontainers/ci@v0.3 + with: + runCmd: devenv test \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b755b91 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +on: + release: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build linux image + run: docker run --rm -v "${PWD}:/src/" --env SPECFILE=./schwifty.spec batonogov/pyinstaller-linux + + - name: Test linux image + run: dist/schwifty "DE89370400440532013000" + + - uses: shogo82148/actions-upload-release-asset@v1 + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: dist/schwifty diff --git a/devenv.nix b/devenv.nix index b4e8f8e..db8bd1c 100644 --- a/devenv.nix +++ b/devenv.nix @@ -19,8 +19,8 @@ echo "testing source..." schwifty-src "DE89370400440532013000" | jq '.' - echo "testing binary..." - schwifty "DE89370400440532013000" | jq '.' + # echo "testing binary..." + # schwifty "DE89370400440532013000" | jq '.' ''; # https://devenv.sh/scripts/