Update version number to 0.4.0 #20
Workflow file for this run
This file contains 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: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create GitHub release | |
uses: Roang-zero1/github-create-release-action@v3 | |
with: | |
version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ | |
env: | |
GITHUB_TOKEN: ${{ secrets.APT_REPO_ACCESS_TOKEN }} | |
create_homebrew_tap: | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Checkout apt repository | |
uses: actions/checkout@v2 | |
with: | |
repository: TNG/homebrew-please | |
ref: main | |
token: ${{ secrets.APT_REPO_ACCESS_TOKEN }} | |
path: brew-repo | |
- name: Create Homebrew Release file | |
run: | | |
export TAG="${{ github.ref }}" | |
export VERSION=$(echo "${TAG}" | sed 's/^refs\/tags\/v//') | |
export URL="https://github.com/TNG/please-cli/archive/${TAG}.zip" | |
wget "${URL}" | |
export SHA_SUM=$(sha256sum "v${VERSION}.zip" | awk '{print $1}') | |
cd brew-repo/Formula | |
echo "class Please < Formula | |
desc \"An AI helper script to create CLI commands\" | |
homepage \"https://tng.github.io/please-cli/\" | |
version \"${VERSION}\" | |
url \"${URL}\" | |
sha256 \"${SHA_SUM}\" | |
depends_on \"jq\" | |
depends_on \"curl\" | |
def install | |
bin.install \"please.sh\" => \"please\" | |
end | |
test do | |
system \"#{bin}/please\", \"--help\" | |
end | |
end" > please.rb | |
cat please.rb | |
- name: Commit and push changes | |
run: | | |
export TAG="${{ github.ref }}" | |
cd brew-repo | |
git config --local user.email "[email protected]" | |
git config --local user.name "TNG Technology Consulting" | |
git add . | |
git commit -m "Update Please package to ${TAG}" | |
git push | |
create_apt_repo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Setup dpkg-dev | |
run: sudo apt-get install -y dpkg-dev gnupg2 dpkg-sig apt-utils | |
- name: Setup GPG | |
env: | |
PRIVATE_GPG_KEY: ${{ secrets.PRIVATE_GPG_KEY }} | |
PUBLIC_GPG_KEY: ${{ secrets.PUBLIC_GPG_KEY }} | |
run: | | |
echo "$PRIVATE_GPG_KEY" | gpg --import | |
echo "$PUBLIC_GPG_KEY" | gpg --import | |
- name: Build package | |
run: | | |
export TAG="${{ github.ref }}" | |
export VERSION=$(echo "${TAG}" | sed 's/^refs\/tags\/v//') | |
mkdir please | |
cd please | |
mkdir -p usr/local/bin | |
mkdir DEBIAN | |
mv ../please.sh usr/local/bin/please | |
echo "Package: please | |
Version: ${VERSION} | |
Section: base | |
Priority: optional | |
Architecture: all | |
Maintainer: TNG Technology Consulting GmbH <[email protected]> | |
Depends: curl, jq, libsecret-tools, xclip | |
Description: An AI helper script to create CLI commands" > DEBIAN/control | |
cd .. | |
dpkg-deb --build please | |
dpkg-sig --sign builder please.deb | |
- name: Checkout apt repository | |
uses: actions/checkout@v2 | |
with: | |
repository: TNG/apt-please | |
ref: main | |
token: ${{ secrets.APT_REPO_ACCESS_TOKEN }} | |
path: apt-repo | |
- name: Copy package to apt repository | |
run: cp please.deb apt-repo/ | |
- name: Generate repo | |
run: | | |
cd apt-repo | |
apt-ftparchive packages . > Packages | |
apt-ftparchive release . > Release | |
gpg --batch --yes -abs -o Release.gpg Release | |
gpg --batch --export --armor [email protected] > public_key.gpg | |
- name: Commit and push changes | |
run: | | |
export TAG="${{ github.ref }}" | |
cd apt-repo | |
git config --local user.email "[email protected]" | |
git config --local user.name "TNG Technology Consulting" | |
git add . | |
git commit -m "Update Please package to ${TAG}" | |
git push | |
create_arch_package: | |
runs-on: archarm-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Setup ssh for aur | |
run: | | |
echo "${{ secrets.AUR_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
echo "aur.archlinux.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEuBKrPzbawxA/k2g6NcyV5jmqwJ2s+zpgZGZ7tpLIcN" > ~/.ssh/authorized_keys | |
- name: Update aur PKGBUILD | |
run: | | |
export TAG="${{ github.ref }}" | |
export VERSION=$(echo "${TAG}" | sed 's/^refs\/tags\/v//') | |
git clone ssh://[email protected]/please-cli.git | |
cd please-cli | |
cp ../PKGBUILD PKGBUILD | |
makepkg | |
makepkg --printsrcinfo > .SRCINFO | |
git config --local user.email "[email protected]" | |
git config --local user.name "TNG Technology Consulting" | |
git add . | |
git commit -m "Update version to $VERSION" | |
git push | |
- name: Upload built package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: please-cli arch package ${{ github.ref }} | |
path: please-cli/please-cli-*.pkg.tar | |