From 2e826201d232fea34aa465fafaaa92d3f042c0d5 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Sat, 24 Apr 2021 22:13:48 +0800 Subject: [PATCH] Create publish.yml --- .github/workflows/publish.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..0690e83 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,58 @@ +name: Publish + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: '5.15.2' + modules: 'qtwebengine qtwebsockets' + + # Checkout repository and submodules + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Build + run: | + qmake CONFIG+=release + make + + + aur-publish: + needs: + - build + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Get latest version + id: get-version + run: | + echo ::set-output name=VERSION::$(git tag --sort=-v:refname --list "v[0-9]*" | head -n 1 | cut -c 2-) + + - name: Get the sha256sum + id: get-sha256sum + run: | + echo ::set-output name=SHA::$(curl -L https://github.com/yuezk/GlobalProtect-openconnect/archive/refs/tags/v${{steps.get-version.outputs.VERSION}}.tar.gz | sha256sum) + + - name: Generate PKGBUILD + run: | + sed "s/{PKG_VERSION}/${{steps.get-version.outputs.VERSION}}/g;s/{SOURCE_SHA}/${{steps.get-sha256sum.outputs.SHA}}/g" PKGBUILD.template > PKGBUILD + + - name: Publish AUR package + uses: KSXGitHub/github-actions-deploy-aur@v2.2.3 + with: + pkgname: globalprotect-openconnect + pkgbuild: ./PKGBUILD + commit_username: ${{ secrets.AUR_USERNAME }} + commit_email: ${{ secrets.AUR_EMAIL }} + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}