From 32bd713965df0c6aeaa7a14d068b1acc25202ead Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Mon, 20 Dec 2021 18:32:18 +0800 Subject: [PATCH] update CI --- .github/workflows/build.yml | 3 +- .github/workflows/pre-release.yml | 58 ----------------------------- .github/workflows/publish.yml | 61 ------------------------------- 3 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 .github/workflows/pre-release.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0188d0e..4f49391 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ name: Build on: push: branches: - - master - develop tags: - "v*.*.*" @@ -351,4 +350,4 @@ jobs: - uses: softprops/action-gh-release@v1 with: files: | - ./artifacts/*.tar.gz \ No newline at end of file + ./artifacts/*.tar.gz diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml deleted file mode 100644 index bff4033..0000000 --- a/.github/workflows/pre-release.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Pre Release - -on: - workflow_dispatch: - -jobs: - pre-release: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - env: - DEBFULLNAME: "Kevin Yue" - DEBEMAIL: "yuezk001@gmail.com" - - steps: - # Checkout repository and submodules - - uses: actions/checkout@v2 - with: - submodules: recursive - fetch-depth: 0 - - - name: Init variables - id: vars - run: | - TAG=$(git tag --sort=-v:refname --list "v[0-9]*" | head -n 1 | cut -c 2-) - echo ::set-output name=VERSION::"${TAG}+SNAPSHOT$(date -u +"%Y%m%d%H%M%S")" - echo ::set-output name=TAG::${TAG} - - - name: Update debian/changelog - run: | - sudo apt install devscripts - git log --format="%s" v${{ steps.vars.outputs.TAG }}.. | xargs -L1 dch -v ${{ steps.vars.outputs.VERSION }}-1ppa1 - - - name: "Archive all" - run: | - python -m pip install --upgrade pip - pip install git-archive-all - git-archive-all \ - --force-submodules \ - --prefix=globalprotect-openconnect-${{ steps.vars.outputs.VERSION }}/ \ - ./globalprotect-openconnect-${{ steps.vars.outputs.VERSION }}.full.tar.gz - - name: "Debian Packaging" - run: | - sudo apt update - sudo apt install qtbase5-dev libqt5websockets5-dev qtwebengine5-dev qttools5-dev debhelper - mkdir build-debian && cd build-debian - cp ../*.tar.gz globalprotect-openconnect_${{ steps.vars.outputs.VERSION }}.orig.tar.gz - tar xf *.tar.gz - cd globalprotect-openconnect-${{ steps.vars.outputs.VERSION }} - fakeroot dpkg-buildpackage -uc -us -sa - - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - prerelease: true - title: "globalprotect-openconnect_${{ steps.vars.outputs.VERSION }}" - files: | - *.tar.gz - build-debian/*.deb diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 17b23fa..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Publish - -on: - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Install Qt - uses: jurplel/install-qt-action@v2 - with: - version: 5.12.11 - 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 - with: - fetch-depth: 0 - - - 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 | cut -f1 -d" ") - - - 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.4 - with: - pkgname: globalprotect-openconnect - pkgbuild: ./PKGBUILD - commit_username: ${{ secrets.AUR_USERNAME }} - commit_email: ${{ secrets.AUR_EMAIL }} - ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} - commit_message: 'Release v${{ steps.get-version.outputs.VERSION }}' - force_push: true