From 10d1aab05f8fe1378517ac4e61568903bc597b4e Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 9 Apr 2025 15:34:57 +0200 Subject: [PATCH] add new gh workflows / most of it --- .../workflows/create_package_on_release.yml | 22 ----- .github/workflows/publish.yaml | 80 +++++++++++++++++++ .github/workflows/validate.yaml | 14 ++++ 3 files changed, 94 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/create_package_on_release.yml create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/validate.yaml diff --git a/.github/workflows/create_package_on_release.yml b/.github/workflows/create_package_on_release.yml deleted file mode 100644 index 4f3f95c..0000000 --- a/.github/workflows/create_package_on_release.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: create package on release - -on: - release: - types: [created] - -jobs: - build_package_and_release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: create deb package - run: dpkg-deb --build ./package - - - name: upload release assets - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{github.event.release.tag_name}} - files: "${{github.workspace}}/builds/*" - diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..b7dcd28 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,80 @@ +name: publish +on: + release: + types: published + workflow_dispatch: + inputs: + release_tag: + required: true + description: the tag to release for + default: "" +jobs: + compile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: make compile + - uses: actions/upload-artifact@v4 + with: + name: bin + path: bin/ + # release_deb: + # runs-on: ubuntu-latest + # needs: compile + # steps: + # - uses: actions/download-artifact@v4 + # with: + # name: bin + # path: ${{github.workspace}}/bin + # - if: ${{!env.ACT}} + # uses: softprops/action-gh-release@v2 + # with: + # tag_name: ${{github.event.release.tag_name || github.event.inputs.release_tag}} + # files: bin/coinflip + # fail_on_unmatched_files: true + # env: + # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + # - if: ${{env.ACT}} + # uses: actions/upload-artifact@v4 + # with: + # path: bin/coinflip + # release_aur-bin: + # runs-on: ubuntu-latest + # needs: compile + # steps: + # - uses: actions/download-artifact@v4 + # with: + # name: bin + # path: ${{github.workspace}}/bin + # - if: ${{!env.ACT}} + # uses: softprops/action-gh-release@v2 + # with: + # tag_name: ${{github.event.release.tag_name || github.event.inputs.release_tag}} + # files: bin/coinflip + # fail_on_unmatched_files: true + # env: + # GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + # - if: ${{env.ACT}} + # uses: actions/upload-artifact@v4 + # with: + # path: bin/coinflip + release_bin: + runs-on: ubuntu-latest + needs: compile + steps: + - if: ${{!env.ACT}} + uses: actions/download-artifact@v4 + with: + name: bin + path: ${{github.workspace}}/bin + - uses: softprops/action-gh-release@v2 + with: + tag_name: ${{github.event.release.tag_name || github.event.inputs.release_tag}} + files: bin/coinflip + fail_on_unmatched_files: true + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - if: ${{env.ACT}} + uses: actions/upload-artifact@v4 + with: + path: bin/coinflip diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml new file mode 100644 index 0000000..b3cf5ef --- /dev/null +++ b/.github/workflows/validate.yaml @@ -0,0 +1,14 @@ +name: validate +on: + pull_request: + branches: + - $default-branch + push: + branches: + - $default-branch +jobs: + compile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: make compile