Merge pull request #78 from logfire-ai/repo-sync/cli-private/main #116
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: Goreleaser | |
on: | |
push: | |
tags: | |
- '*' | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set Repository Name | |
run: echo "REPO_NAME=${{ secrets.GITHUB_REPOSITORY }}" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
- name: Run GoReleaser | |
uses: goreleaser/[email protected] | |
with: | |
distribution: goreleaser | |
version: v1.26.2 | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
PRIVATE_KEY_PATH: ${{ secrets.PRIVATE_KEY }} | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: List keys | |
run: | | |
git checkout main | |
gpg -K | |
- name: Copy .deb files to ppa directory | |
run: | | |
mkdir -p ppa | |
cp dist/*.deb ppa/ | |
- name: Install dpkg-dev tools | |
run: sudo apt-get update && sudo apt-get install -y dpkg-dev | |
- name: Generate Packages and Packages.gz | |
run: | | |
cd ppa | |
dpkg-scanpackages --multiversion . > Packages | |
gzip -k -f Packages | |
- name: Generate Release and Release.gpg | |
run: | | |
cd ppa | |
apt-ftparchive release . > Release | |
gpg --batch --default-key "[email protected]" -abs -o - Release > Release.gpg | |
- name: Generate InRelease | |
run: | | |
cd ppa | |
gpg --batch --default-key "[email protected]" --clearsign -o - Release > InRelease | |
- name: Create .list file | |
run: | | |
echo "deb [signed-by=/etc/apt/trusted.gpg.d/KEY.gpg] https://logfire-ai.github.io/cli ./" > ppa/my_list_file.list | |
- name: Fetch all branches | |
run: git fetch --all | |
- name: Checkout and Push to main | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Logfire" | |
git add ppa/* | |
git pull | |
git commit -m "Add generated PPA files" | |
git push origin main | |
- name: Clone gh-pages branch | |
run: | | |
git clone --branch gh-pages https://github.com/logfire-ai/cli.git gh-pages | |
- name: Copy ppa contents to gh-pages | |
run: | | |
cp -r ppa/* gh-pages/ | |
- name: Create YUM repository using Docker | |
run: | | |
docker run --rm -v $PWD:/workspace -w /workspace centos:7 bash -c " | |
yum install -y createrepo rpm-sign # Install rpm-sign for signing | |
mkdir -p yum-repo | |
cp dist/*.rpm yum-repo/ | |
echo '%_gpg_name [email protected]' > ~/.rpmmacros | |
for rpm in yum-repo/*.rpm; do | |
rpm --addsign \$rpm # Sign each RPM package | |
done | |
createrepo yum-repo/" | |
- name: Copy YUM repo to gh-pages | |
run: | | |
mkdir -p gh-pages/yum-repo | |
cp -r yum-repo/* gh-pages/yum-repo/ | |
- name: Commit and Push to gh-pages | |
run: | | |
cd gh-pages | |
git config --local user.email "[email protected]" | |
git config --local user.name "Logfire" | |
git remote set-url origin https://x-access-token:${{ secrets.TOKEN }}@github.com/logfire-ai/cli.git | |
git add . | |
git pull | |
git commit -m "Update GitHub Pages with YUM repo" | |
git push origin gh-pages | |
env: | |
GIT_CREDENTIALS: ${{ secrets.TOKEN }} |