From b481a0e710fef7e81799f5965eff7e24a6f8ad8f Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 26 Aug 2023 16:46:51 +0200 Subject: [PATCH 1/7] chore: skip deploy when not released --- .github/workflows/deploy.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3c1c797..f020a93 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,6 +2,8 @@ name: CI on: push: + branches: + - main tags: - v* @@ -17,8 +19,10 @@ jobs: image: sensson/rpmbuild:rockylinux-8 options: -v ${{ github.workspace }}:/srv -e RELEASE=${{ github.ref }} - name: Dependencies + if: startsWith(github.ref, 'refs/tags/') run: pip install --user cloudsmith-cli - name: Deploy + if: startsWith(github.ref, 'refs/tags/') run: bash deploy-rpm.sh env: APIKEY: ${{ secrets.APIKEY }} @@ -44,8 +48,10 @@ jobs: arch: 'amd64' desc: 'Backups scripts to be used by Acronis to make backups of MySQL.' - name: Dependencies + if: startsWith(github.ref, 'refs/tags/') run: pip install --user cloudsmith-cli - name: Deploy + if: startsWith(github.ref, 'refs/tags/') run: bash deploy-deb.sh env: APIKEY: ${{ secrets.APIKEY }} From 95a0d9751eee2a648d51c264a5644e732c8952e7 Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 26 Aug 2023 16:48:18 +0200 Subject: [PATCH 2/7] chore: revert to docker run --- .github/workflows/deploy.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f020a93..6e40506 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,10 +14,8 @@ jobs: - uses: actions/checkout@v2 - name: Permissions run: chmod 777 -R . - - uses: ju5t/docker-run-action@v0.0.3 - with: - image: sensson/rpmbuild:rockylinux-8 - options: -v ${{ github.workspace }}:/srv -e RELEASE=${{ github.ref }} + - name: Build + run: docker run -v ${{ github.workspace }}:/srv -e RELEASE=${{ github.ref }} sensson/rpmbuild:rockylinux-8 - name: Dependencies if: startsWith(github.ref, 'refs/tags/') run: pip install --user cloudsmith-cli From 0ac595cda9f882131939bdf40273a0d7716d943e Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 26 Aug 2023 16:53:59 +0200 Subject: [PATCH 3/7] chore: prepare for version replace --- rpmbuild/SPECS/acronis-mysql-scripts.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpmbuild/SPECS/acronis-mysql-scripts.spec b/rpmbuild/SPECS/acronis-mysql-scripts.spec index 2e49d59..e3fa103 100644 --- a/rpmbuild/SPECS/acronis-mysql-scripts.spec +++ b/rpmbuild/SPECS/acronis-mysql-scripts.spec @@ -1,5 +1,5 @@ Name: acronis-mysql-scripts -Version: %{version} +Version: ##version## Release: 1 License: MIT Summary: MySQL backup scripts for Acronis From c1c3ba598dd3dfc31d9231a1d1dfc92e7482fdf3 Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 26 Aug 2023 16:56:36 +0200 Subject: [PATCH 4/7] chore: set version dynamically --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6e40506..153bde9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,8 +14,10 @@ jobs: - uses: actions/checkout@v2 - name: Permissions run: chmod 777 -R . + - name: Version + run: sed -i 's/##version##/${{ github.ref }}/g' rpmbuild/SPECS/acronis-mysql-scripts.spec - name: Build - run: docker run -v ${{ github.workspace }}:/srv -e RELEASE=${{ github.ref }} sensson/rpmbuild:rockylinux-8 + run: docker run -v ${{ github.workspace }}:/srv -e RELEASE= sensson/rpmbuild:rockylinux-8 - name: Dependencies if: startsWith(github.ref, 'refs/tags/') run: pip install --user cloudsmith-cli From 791882a2d7bb5a263d1b179571ea41ae9eee2ad1 Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 26 Aug 2023 17:02:17 +0200 Subject: [PATCH 5/7] chore: use correct variable --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 153bde9..a9a5919 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: - name: Permissions run: chmod 777 -R . - name: Version - run: sed -i 's/##version##/${{ github.ref }}/g' rpmbuild/SPECS/acronis-mysql-scripts.spec + run: sed -i 's/##version##/${GITHUB_REF_NAME/v/}' rpmbuild/SPECS/acronis-mysql-scripts.spec - name: Build run: docker run -v ${{ github.workspace }}:/srv -e RELEASE= sensson/rpmbuild:rockylinux-8 - name: Dependencies From 9681a6e84836020df6bea4ca7f59bfb530e872c0 Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 26 Aug 2023 17:03:03 +0200 Subject: [PATCH 6/7] chore: complete sed --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a9a5919..3cd5c8e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: - name: Permissions run: chmod 777 -R . - name: Version - run: sed -i 's/##version##/${GITHUB_REF_NAME/v/}' rpmbuild/SPECS/acronis-mysql-scripts.spec + run: sed -i 's/##version##/${GITHUB_REF_NAME/v/}/g' rpmbuild/SPECS/acronis-mysql-scripts.spec - name: Build run: docker run -v ${{ github.workspace }}:/srv -e RELEASE= sensson/rpmbuild:rockylinux-8 - name: Dependencies From 0ba3bb95ff1f7a71600eb3606df374bd5c063a33 Mon Sep 17 00:00:00 2001 From: ju5t Date: Sat, 26 Aug 2023 17:07:41 +0200 Subject: [PATCH 7/7] chore: use different sed command --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3cd5c8e..65d2cb2 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: - name: Permissions run: chmod 777 -R . - name: Version - run: sed -i 's/##version##/${GITHUB_REF_NAME/v/}/g' rpmbuild/SPECS/acronis-mysql-scripts.spec + run: sed -i "s/##version##/${GITHUB_REF_NAME#v}/g" rpmbuild/SPECS/acronis-mysql-scripts.spec - name: Build run: docker run -v ${{ github.workspace }}:/srv -e RELEASE= sensson/rpmbuild:rockylinux-8 - name: Dependencies