From 11932dda885c8a40f726ced152d142406ecb00e7 Mon Sep 17 00:00:00 2001 From: jackun Date: Sun, 29 Nov 2020 16:10:59 +0200 Subject: [PATCH] build package workflow, maybe --- .github/workflows/build-package.yml | 41 +++++++++++++++++++++++++++++ .github/workflows/build-source.yml | 2 -- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-package.yml diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml new file mode 100644 index 00000000..ac5603c6 --- /dev/null +++ b/.github/workflows/build-package.yml @@ -0,0 +1,41 @@ +name: Build release package +on: + release: + types: ["created"] + push: + tags: ["v*"] + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build release package + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ./build-source.sh + ./build.sh build package release + - if: github.event_name == 'release' + name: Upload release + run: | + assets=() + for asset in ./MangoHud-*-Source*.tar.gz; do + assets+=("-a" "$asset") + done + for asset in ./build/MangoHud-*.tar.gz; do + assets+=("-a" "$asset") + done + tag_name="${GITHUB_REF##*/}" + hub release create "${assets[@]}" -m "$tag_name" "$tag_name" + - name: Upload artifact + uses: actions/upload-artifact@v2 + continue-on-error: true + with: + name: MangoHud-${{github.ref}}-${{github.sha}} + path: ${{runner.workspace}}/build/MangoHud-*tar.gz + retention-days: 30 \ No newline at end of file diff --git a/.github/workflows/build-source.yml b/.github/workflows/build-source.yml index a526a004..1b16e322 100644 --- a/.github/workflows/build-source.yml +++ b/.github/workflows/build-source.yml @@ -2,8 +2,6 @@ name: Build source tars on: release: types: ["published"] - push: - tags: ["v*"] workflow_dispatch: jobs: