Release #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version' | |
| required: true | |
| jobs: | |
| Release-GitHub: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repo" | |
| uses: actions/checkout@v4 | |
| - name: Create tag | |
| if: github.ref == 'refs/heads/Mainline' | |
| uses: rickstaa/action-create-tag@v1 | |
| with: | |
| tag: "v${{ github.event.inputs.version }}" | |
| - name: Release | |
| if: github.ref == 'refs/heads/main' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ${{ github.workspace }}/git-credential-outlook | |
| ${{ github.workspace }}/git-credential-gmail | |
| tag_name: "v${{ github.event.inputs.version }}" | |
| draft: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| Release-Debian-Outlook: | |
| needs: [Release-GitHub] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repo" | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: v${{ github.event.inputs.version }} | |
| - name: Configure GPG Key | |
| run: | | |
| echo -n "$GPG_SIGNING_KEY" | base64 -di | gpg --import | |
| env: | |
| GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
| - name: Release | |
| id: publish | |
| run: | | |
| sudo apt update | |
| sudo apt install -y wget git gpg apt-utils dpkg-dev | |
| git checkout v${{ github.event.inputs.version }} | |
| cd ${{ github.workspace }} | |
| mkdir -p ${{ github.workspace }}/cred/DEBIAN | |
| mkdir -p ${{ github.workspace }}/cred/usr/bin | |
| cp ./git-credential-outlook ./cred/usr/bin | |
| cat <<EOF > ./cred/DEBIAN/control | |
| Package: git-credential-outlook | |
| Version: ${{ github.event.inputs.version }} | |
| Section: utils | |
| Priority: optional | |
| Depends: git-email, python3-msal, python3-keyring, python3-trustme, python3-pyqt6, python3-pyqt6.qtwebengine | |
| Enhances: git-email | |
| Architecture: all | |
| Maintainer: Aditya Garg <[email protected]> | |
| Description: Git credential helper for Microsoft Outlook accounts. | |
| EOF | |
| chmod a+x ./cred/DEBIAN/control | |
| chmod a+x ./cred/usr/bin/git-credential-outlook | |
| dpkg-deb --build --root-owner-group -Zgzip cred | |
| dpkg-name cred.deb | |
| gh release download debian -D debian -R AdityaGarg8/git-credential-email | |
| mv -v ./*.deb ./debian | |
| cd debian | |
| dpkg-scanpackages --multiversion . > Packages | |
| gzip -k -f Packages | |
| apt-ftparchive release . > Release | |
| gpg --default-key "${GPG_SIGNING_EMAIL}" -abs -o - Release > Release.gpg | |
| gpg --default-key "${GPG_SIGNING_EMAIL}" --clearsign -o - Release > InRelease | |
| gh release upload debian ./* --clobber -R AdityaGarg8/git-credential-email | |
| env: | |
| GPG_SIGNING_EMAIL: ${{ secrets.GPG_SIGNING_EMAIL }} | |
| GH_TOKEN: ${{ secrets.PAT }} | |
| Release-Debian-Gmail: | |
| needs: [Release-Debian-Outlook] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repo" | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: v${{ github.event.inputs.version }} | |
| - name: Configure GPG Key | |
| run: | | |
| echo -n "$GPG_SIGNING_KEY" | base64 -di | gpg --import | |
| env: | |
| GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
| - name: Release | |
| id: publish | |
| run: | | |
| sudo apt update | |
| sudo apt install -y wget git gpg apt-utils dpkg-dev | |
| git checkout v${{ github.event.inputs.version }} | |
| cd ${{ github.workspace }} | |
| mkdir -p ${{ github.workspace }}/cred/DEBIAN | |
| mkdir -p ${{ github.workspace }}/cred/usr/bin | |
| cp ./git-credential-gmail ./cred/usr/bin | |
| cat <<EOF > ./cred/DEBIAN/control | |
| Package: git-credential-gmail | |
| Version: ${{ github.event.inputs.version }} | |
| Section: utils | |
| Priority: optional | |
| Depends: git-email, python3-keyring, python3-pyqt6, python3-pyqt6.qtwebengine | |
| Enhances: git-email | |
| Architecture: all | |
| Maintainer: Aditya Garg <[email protected]> | |
| Description: Git credential helper for Gmail accounts. | |
| EOF | |
| chmod a+x ./cred/DEBIAN/control | |
| chmod a+x ./cred/usr/bin/git-credential-gmail | |
| dpkg-deb --build --root-owner-group -Zgzip cred | |
| dpkg-name cred.deb | |
| gh release download debian -D debian -R AdityaGarg8/git-credential-email | |
| mv -v ./*.deb ./debian | |
| cd debian | |
| dpkg-scanpackages --multiversion . > Packages | |
| gzip -k -f Packages | |
| apt-ftparchive release . > Release | |
| gpg --default-key "${GPG_SIGNING_EMAIL}" -abs -o - Release > Release.gpg | |
| gpg --default-key "${GPG_SIGNING_EMAIL}" --clearsign -o - Release > InRelease | |
| gh release upload debian ./* --clobber -R AdityaGarg8/git-credential-email | |
| env: | |
| GPG_SIGNING_EMAIL: ${{ secrets.GPG_SIGNING_EMAIL }} | |
| GH_TOKEN: ${{ secrets.PAT }} | |
| Release-Fedora-Outlook: | |
| needs: [Release-GitHub] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repo" | |
| uses: actions/checkout@v4 | |
| - name: Release | |
| id: publish | |
| run: | | |
| cat <<EOF > ./git-credential-outlook.spec | |
| Name: git-credential-outlook | |
| Version: ${{ github.event.inputs.version }} | |
| Release: 1%{?dist} | |
| Summary: Git credential helper for Microsoft Outlook accounts. | |
| License: Apache-2.0 | |
| URL: https://github.com/AdityaGarg8/git-credential-email | |
| Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz | |
| BuildArch: noarch | |
| Requires: git-email | |
| Requires: python-msal | |
| Requires: python-keyring | |
| Requires: python-trustme | |
| Requires: python-pyqt6 | |
| Requires: python-pyqt6-webengine | |
| %description | |
| Git credential helper for Microsoft Outlook accounts. | |
| %prep | |
| %autosetup -n git-credential-email-${{ github.event.inputs.version }} | |
| %build | |
| %install | |
| install -D -m0755 git-credential-outlook %{buildroot}%{_bindir}/git-credential-outlook | |
| %files | |
| %license LICENSE | |
| %doc README.md | |
| %{_bindir}/git-credential-outlook | |
| EOF | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git pull | |
| git add . | |
| git commit -m "Update Fedora package (Outlook) to ${{ github.event.inputs.version }}" || true | |
| - name: Push changes to the repo | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} | |
| - name: "Trigger COPR webhook" | |
| run: | | |
| curl -sS -X POST $COPR_WEBHOOK/git-credential-outlook | |
| env: | |
| COPR_WEBHOOK: ${{ secrets.COPR_WEBHOOK }} | |
| Release-Fedora-Gmail: | |
| needs: [Release-Fedora-Outlook] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repo" | |
| uses: actions/checkout@v4 | |
| - name: Release | |
| id: publish | |
| run: | | |
| cat <<EOF > ./git-credential-gmail.spec | |
| Name: git-credential-gmail | |
| Version: ${{ github.event.inputs.version }} | |
| Release: 1%{?dist} | |
| Summary: Git credential helper for Gmail accounts. | |
| License: Apache-2.0 | |
| URL: https://github.com/AdityaGarg8/git-credential-email | |
| Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz | |
| BuildArch: noarch | |
| Requires: git-email | |
| Requires: python-keyring | |
| Requires: python-pyqt6 | |
| Requires: python-pyqt6-webengine | |
| %description | |
| Git credential helper for Gmail accounts. | |
| %prep | |
| %autosetup -n git-credential-email-${{ github.event.inputs.version }} | |
| %build | |
| %install | |
| install -D -m0755 git-credential-gmail %{buildroot}%{_bindir}/git-credential-gmail | |
| %files | |
| %license LICENSE NOTICE | |
| %doc README.md | |
| %{_bindir}/git-credential-gmail | |
| EOF | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git pull | |
| git add . | |
| git commit -m "Update Fedora package (Gmail) to ${{ github.event.inputs.version }}" || true | |
| - name: Push changes to the repo | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} | |
| - name: "Trigger COPR webhook" | |
| run: | | |
| curl -sS -X POST $COPR_WEBHOOK/git-credential-gmail | |
| env: | |
| COPR_WEBHOOK: ${{ secrets.COPR_WEBHOOK }} | |
| Release-Homebrew: | |
| needs: [Release-GitHub] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout Repo" | |
| uses: actions/checkout@v4 | |
| - name: Get SHA256SUM | |
| id: compute_sha | |
| run: | | |
| wget https://github.com/AdityaGarg8/git-credential-email/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz | |
| SHASUM=$(sha256sum ./v${{ github.event.inputs.version }}.tar.gz | cut -d " " -f 1 | xargs) | |
| echo "sha=$SHASUM" >> $GITHUB_ENV | |
| - name: Release | |
| id: publish | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git clone https://github.com/AdityaGarg8/homebrew-git-credential-email | |
| cd homebrew-git-credential-email | |
| sed -i -E \ | |
| -e 's|url "https://github.com/AdityaGarg8/git-credential-email/archive/refs/tags/v[0-9]+(\.[0-9]+)+\.tar\.gz"|url "https://github.com/AdityaGarg8/git-credential-email/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz"|' \ | |
| -e '0,/sha256 "[a-f0-9]{64}"/s//sha256 "${{ env.sha }}"/' \ | |
| git-credential-outlook.rb git-credential-gmail.rb | |
| cd .. | |
| - name: Publish to repo | |
| uses: cpina/github-action-push-to-another-repository@main | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.PAT }} | |
| with: | |
| source-directory: 'homebrew-git-credential-email' | |
| destination-github-username: 'AdityaGarg8' | |
| destination-repository-name: 'homebrew-git-credential-email' | |
| user-email: github-actions[bot]@users.noreply.github.com | |
| user-name: github-actions[bot] | |
| target-branch: main | |
| commit-message: Update credential helpers to v${{ github.event.inputs.version }} |