Skip to content

Release

Release #13

Workflow file for this run

---
name: Release - Debian and Fedora
on:
workflow_dispatch:
inputs:
version:
description: 'Version of the deb and rpm package'
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-send-outlook
tag_name: "v${{ github.event.inputs.version }}"
draft: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Release-Debian:
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: python3-msal, python3-keyring, python3-trustme, python3-pyqt6, python3-pyqt6.qtwebengine
Enhances: git
Architecture: all
Maintainer: Aditya Garg <gargaditya08@live.com>
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-outlook-and-gmail
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-outlook-and-gmail
env:
GPG_SIGNING_EMAIL: ${{ secrets.GPG_SIGNING_EMAIL }}
GH_TOKEN: ${{ secrets.PAT }}
Release-Fedora:
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-outlook-and-gmail
Source0: %{url}/archive/refs/tags/v${{ github.event.inputs.version }}.tar.gz
BuildArch: noarch
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-outlook-and-gmail-${{ 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 add .
git commit -m "Update Fedora package 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 }}