From f9f68b1819c7f7a527131e3ce84282f2872a3043 Mon Sep 17 00:00:00 2001 From: "Florine W. Dekker" Date: Wed, 29 Nov 2023 13:57:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=92=20mommy=20fixes=20her=20apt=20repo?= =?UTF-8?q?sitory=20release=20script~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 96 ++++++++++++++++++++++++---------------- .github/workflows/ci.yml | 34 +++++++------- CHANGELOG.md | 7 ++- version | 2 +- 4 files changed, 82 insertions(+), 57 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f3c0f3e..e3b3f2f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,8 +1,10 @@ name: CD on: + # 'push' creates a real release push: branches: [ main ] + # 'workflow_dispatch' does a dry run of the workflow workflow_dispatch: permissions: @@ -11,7 +13,6 @@ permissions: jobs: check-release-needed: - # Note that 'workflow_dispatch' is never skipped if: "!(contains(github.event.head_commit.message, '[cd skip]') || contains(github.event.head_commit.message, '[skip cd]'))" runs-on: ubuntu-latest steps: @@ -174,7 +175,6 @@ jobs: release-mommy: needs: [ build-linux, build-macos, build-freebsd, build-netbsd, build-openbsd ] runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' && github.event_name != 'workflow_dispatch' steps: - name: Checkout @@ -190,63 +190,75 @@ jobs: uses: ffurrer2/extract-release-notes@v1 with: release_notes_file: RELEASE_NOTES.md + - name: Prepend release notes + run: | + echo -e "mommy can also be installed using a package manager. [check the readme for more info](https://github.com/FWDekker/mommy/tree/${MOMMY_VERSION}#-installation)~\n" | cat - RELEASE_NOTES.md | tee RELEASE_NOTES.md - name: Checkout release uses: softprops/action-gh-release@v1 + if: github.event_name != 'workflow_dispatch' with: draft: false prerelease: false tag_name: ${{ env.MOMMY_VERSION }} body_path: RELEASE_NOTES.md files: mommy* + discussion_category_name: announcements release-apt: needs: [ release-mommy ] runs-on: ubuntu-latest steps: - - name: Download built packages - uses: actions/download-artifact@v3 - with: - name: dist - name: Checkout mommy uses: actions/checkout@v4 + with: + path: src-mommy + - name: Extract version number + run: echo "MOMMY_VERSION=v$(head -n 1 ./src-mommy/version)" >> $GITHUB_ENV + - name: Checkout apt-mommy uses: actions/checkout@v4 with: repository: fwdekker/apt-mommy + path: apt-mommy + ref: main + fetch-depth: 0 + # Required to push '.deb' to repository token: ${{ secrets.personal_access_token }} - - name: Extract version number - run: echo "MOMMY_VERSION=v$(head -n 1 ./mommy/version)" >> $GITHUB_ENV + - name: Download built packages + uses: actions/download-artifact@v3 + with: + name: dist + path: dist-mommy + - name: Move .deb into apt-mommy + run: cp dist-mommy/*.deb apt-mommy/deb/ + - name: Import GPG key run: echo "$apt_gpg_private_key" | gpg --import env: apt_gpg_private_key: ${{ secrets.apt_gpg_private_key }} - - name: Update apt repository + - name: Update apt-mommy + working-directory: apt-mommy run: | - echo "::group::Copy .deb into apt-mommy" - cp *.deb apt-mommy/deb/ - echo "::endgroup::" - - echo "::group::Update repo" - cd apt-mommy/ + echo "::group::Run update script" ./update.sh - cd ../ echo "::endgroup::" - echo "::group::Commit update" - cd apt-mommy/ + echo "::group::Commit changes" git add --all git config --global user.name "FWDekkerBot" git config --global user.email "bot@fwdekker.com" git commit -am "🔖 mommy added package mommy $MOMMY_VERSION~" - cd ../ echo "::endgroup::" - echo "::group::Push changes" - cd apt-mommy/ - git push origin - cd ../ - echo "::endgroup::" + if [ "${{ github.event_name }}" != "workflow_dispatch" ]; then + echo "::group::Push changes" + git push origin + echo "::endgroup::" + else + echo "::group::Not pushing changes" + echo "::endgroup::" + fi; release-aur: needs: [ release-mommy ] @@ -272,10 +284,9 @@ jobs: - name: Checkout mommy uses: actions/checkout@v4 with: - path: mommy - token: ${{ secrets.personal_access_token }} + path: src-mommy - name: Extract version number - run: echo "MOMMY_VERSION=v$(head -n 1 ./mommy/version)" >> $GITHUB_ENV + run: echo "MOMMY_VERSION=v$(head -n 1 ./src-mommy/version)" >> $GITHUB_ENV - name: Checkout aur-mommy uses: actions/checkout@v4 @@ -289,7 +300,7 @@ jobs: - name: Fix aur-mommy directory ownership run: chown -R build:build ./aur-mommy/ - name: Update build files - working-directory: ./aur-mommy/ + working-directory: aur-mommy run: | echo "::group::Fast-forward main" sudo -u build git checkout dev @@ -312,9 +323,14 @@ jobs: sudo -u build git merge --commit master echo "::endgroup::" - echo "::group::Push changes" - sudo -u build git push origin master dev - echo "::endgroup::" + if [ "${{ github.event_name }}" != "workflow_dispatch" ]; then + echo "::group::Push changes" + sudo -u build git push origin master dev + echo "::endgroup::" + else + echo "::group::Not pushing changes" + echo "::endgroup::" + fi; release-homebrew: needs: [ release-mommy ] @@ -324,10 +340,9 @@ jobs: - name: Checkout mommy uses: actions/checkout@v4 with: - path: mommy - token: ${{ secrets.personal_access_token }} + path: src-mommy - name: Extract version number - run: echo "MOMMY_VERSION=v$(head -n 1 ./mommy/version)" >> $GITHUB_ENV + run: echo "MOMMY_VERSION=v$(head -n 1 ./src-mommy/version)" >> $GITHUB_ENV - name: Checkout homebrew-mommy uses: actions/checkout@v4 @@ -339,7 +354,7 @@ jobs: # Required to trigger CI action when pushed token: ${{ secrets.personal_access_token }} - name: Update formula - working-directory: ./homebrew-mommy/ + working-directory: homebrew-mommy run: | echo "::group::Fast-forward main" git checkout dev @@ -362,6 +377,11 @@ jobs: git merge --commit main echo "::endgroup::" - echo "::group::Push changes" - git push origin main dev - echo "::endgroup::" + if [ "${{ github.event_name }}" != "workflow_dispatch" ]; then + echo "::group::Push changes" + git push origin main dev + echo "::endgroup::" + else + echo "::group::Not pushing changes" + echo "::endgroup::" + fi; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c310d2d..8c6fa19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -401,12 +401,12 @@ jobs: test-netbsd: - runs-on: macos-latest + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v4 - name: Test script and package - uses: vmactions/netbsd-vm@v0 + uses: vmactions/netbsd-vm@v1 with: usesh: true prepare: | @@ -446,21 +446,21 @@ jobs: gmake test echo "::endgroup::" - echo "::group::Build package" - gmake dist/netbsd - echo "::endgroup::" - - echo "::group::Install package" - pkg_add ./dist/mommy-*+netbsd.tgz - echo "::endgroup::" - - echo "::group::Test package" - MOMMY_SYSTEM=1 gmake test - echo "::endgroup::" - - echo "::group::Uninstall package" - pkg_delete mommy - echo "::endgroup::" +# echo "::group::Build package" +# gmake dist/netbsd +# echo "::endgroup::" +# +# echo "::group::Install package" +# pkg_add ./dist/mommy-*+netbsd.tgz +# echo "::endgroup::" +# +# echo "::group::Test package" +# MOMMY_SYSTEM=1 gmake test +# echo "::endgroup::" +# +# echo "::group::Uninstall package" +# pkg_delete mommy +# echo "::endgroup::" test-openbsd: diff --git a/CHANGELOG.md b/CHANGELOG.md index 06a1a6e..587cfd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog -## [1.2.5] -- 2023-11-28 +## [1.2.6] -- 2023-11-29 +### fixed +* 🚒 mommy fixes her apt repository release script~ ([#73](https://github.com/FWDekker/mommy/issues/73)) + + +## [1.2.5] -- 2023-11-29 ### added * 📈 mommy now explains how to integrate with nushell, thanks to [aemogie.](https://github.com/aemogie)~ ([#65](https://github.com/FWDekker/mommy/issues/65)) diff --git a/version b/version index e481ace..5949c7f 100644 --- a/version +++ b/version @@ -1,2 +1,2 @@ -1.2.5 +1.2.6 2023-11-29