Skip to content

Commit

Permalink
Merge b13f6a3 into b58f2be
Browse files Browse the repository at this point in the history
  • Loading branch information
donhardman committed May 14, 2024
2 parents b58f2be + b13f6a3 commit 7ca5e14
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 83 deletions.
209 changes: 127 additions & 82 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'v*.*.*'
branches:
- main
- feature/update-deps-with-commits

env:
APP_NAME: 'manticore-backup'
Expand All @@ -23,7 +24,7 @@ jobs:
deb_suffix: ${{ steps.vars.outputs.deb_suffix }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: vars
run: |
version=$(<APP_VERSION)
Expand All @@ -41,7 +42,7 @@ jobs:
needs:
- vars
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build binary
run: |
git clone https://github.com/manticoresoftware/phar_builder.git
Expand Down Expand Up @@ -115,7 +116,7 @@ jobs:
needs:
- vars
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build binary
run: |
git clone https://github.com/manticoresoftware/phar_builder.git
Expand Down Expand Up @@ -214,7 +215,7 @@ jobs:
- build-linux-packages
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
Expand All @@ -233,104 +234,148 @@ jobs:
draft: true
prerelease: false

deploy:
needs:
- build-artifact
- sign-windows-artifact
- build-linux-packages
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- artifact: artifact-deb
type: deb
arch: all
delimiter: "-"
distro: buster
- artifact: artifact-deb
type: deb
arch: all
delimiter: "-"
distro: bionic
- artifact: artifact-deb
type: deb
arch: all
delimiter: "-"
distro: focal
- artifact: artifact-deb
type: deb
arch: all
delimiter: "-"
distro: jammy
- artifact: artifact-deb
type: deb
arch: all
delimiter: "-"
distro: bullseye
- artifact: artifact-deb
type: deb
arch: all
delimiter: "-"
distro: bookworm
- artifact: artifact-el7-rpm
type: rpm
arch: noarch
delimiter: "_"
distro: 7
- artifact: artifact-el8-rpm
type: rpm
arch: noarch
delimiter: "_"
distro: 8
- artifact: artifact-el9-rpm
type: rpm
arch: noarch
delimiter: "_"
distro: 9
- artifact: artifact
type: arc
arch: noarch
delimiter: "-"
distro: ""
steps:
- name: Deploy package
uses: manticoresoftware/publish_to_repo@main
with:
ssh_key: ${{ secrets.REPO_SSH_KEY }}
distr: ${{ matrix.distro }}
arch: ${{ matrix.arch }}
artifact: ${{ matrix.artifact }}
type: ${{ matrix.type }}
delimiter: ${{ matrix.delimiter }}
#deploy:
#needs:
#- build-artifact
#- sign-windows-artifact
#- build-linux-packages
#runs-on: ubuntu-22.04
#strategy:
#matrix:
#include:
#- artifact: artifact-deb
#type: deb
#arch: all
#delimiter: "-"
#distro: buster
#- artifact: artifact-deb
#type: deb
#arch: all
#delimiter: "-"
#distro: bionic
#- artifact: artifact-deb
#type: deb
#arch: all
#delimiter: "-"
#distro: focal
#- artifact: artifact-deb
#type: deb
#arch: all
#delimiter: "-"
#distro: jammy
#- artifact: artifact-deb
#type: deb
#arch: all
#delimiter: "-"
#distro: bullseye
#- artifact: artifact-deb
#type: deb
#arch: all
#delimiter: "-"
#distro: bookworm
#- artifact: artifact-el7-rpm
#type: rpm
#arch: noarch
#delimiter: "_"
#distro: 7
#- artifact: artifact-el8-rpm
#type: rpm
#arch: noarch
#delimiter: "_"
#distro: 8
#- artifact: artifact-el9-rpm
#type: rpm
#arch: noarch
#delimiter: "_"
#distro: 9
#- artifact: artifact
#type: arc
#arch: noarch
#delimiter: "-"
#distro: ""
#steps:
#- name: Deploy package
#uses: manticoresoftware/publish_to_repo@main
#with:
#ssh_key: ${{ secrets.REPO_SSH_KEY }}
#distr: ${{ matrix.distro }}
#arch: ${{ matrix.arch }}
#artifact: ${{ matrix.artifact }}
#type: ${{ matrix.type }}
#delimiter: ${{ matrix.delimiter }}

update-manticoresearch-deps:
needs:
- vars
- deploy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup vars
id: deps-vars
run: |
echo "name=backup" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
with:
path: repository
fetch-depth: 20
- uses: actions/checkout@v4
with:
path: manticoresearch
repository: "manticoresoftware/manticoresearch"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get original commit
id: commit
run: |
cd manticoresearch
version=$( cat deps.txt | grep ${{ steps.deps-vars.outputs.name }} | cut -d' ' -f2 )
date=$( cat deps.txt | grep ${{ steps.deps-vars.outputs.name }} | cut -d' ' -f3 )
commit=$( cat deps.txt | grep ${{ steps.deps-vars.outputs.name }} | cut -d' ' -f4 )
echo "original_version=$version" >> $GITHUB_OUTPUT
echo "original_date=$date" >> $GITHUB_OUTPUT
echo "original_commit=$commit" >> $GITHUB_OUTPUT
cd ..
- name: Update deps.txt
id: deps
id: deps-version
run: |
cd manticoresearch
version=${{ needs.vars.outputs.app_version }}
date=${{ needs.vars.outputs.app_date }}
commit=${{ needs.vars.outputs.app_commit }}
name=${{ steps.deps-vars.outputs.name }}
version_string="$version $date $commit"
echo "version_string=${version_string// /-}" >> $GITHUB_OUTPUT
sed -i '/^backup\s/c\backup '"$version_string" deps.txt
sed -i '/^'$name'\s/c\'$name' '"$version_string" deps.txt
cd ..
- name: Prepare commit message
id: commit-message
run: |
cd repository
repo_url=${{ github.server_url }}/${{ github.repository }}
changes=$(git log --pretty=format:"[\`%h\`]($repo_url/commit/%H) %s" ${{ steps.commit.outputs.original_commit }}..HEAD)
name=${{ steps.deps-vars.outputs.name }}
branch="update-${name}-version"
title="Update ${name} version"
commit="Bump ${name} version to: ${{ steps.deps.outputs.version_string }}"
body_path=$(mktemp)
echo "Update [${name}](${repo_url}) version to: ${{ steps.deps.outputs.version_string }}" > "$body_path"
echo >> "$body_path"
echo "$changes" >> "$body_path"
echo "branch=$branch" >> $GITHUB_OUTPUT
echo "title=$title" >> $GITHUB_OUTPUT
echo "commit=$commit" >> $GITHUB_OUTPUT
echo "body-path=$body_path" >> $GITHUB_OUTPUT
cd ..
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
path: manticoresearch
token: ${{ secrets.PR_TOKEN }}
commit-message: "Bump backup version to: ${{ steps.deps.outputs.version_string }}"
title: "Update backup version"
body: "Updating backup version to ${{ steps.deps.outputs.version_string }}"
branch: "update-backup-version"
commit-message: ${{ steps.commit-message.outputs.commit }}
title: ${{ steps.commit-message.outputs.title }}
body-path: ${{ steps.commit-message.outputs.body-path }}
branch: ${{ steps.commit-message.outputs.branch }}
draft: false
2 changes: 1 addition & 1 deletion APP_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.5
1.3.7

0 comments on commit 7ca5e14

Please sign in to comment.