-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👭 merge pull request #71 from FWDekker/obs~
👭 mommy publishes to a debian repo~
- Loading branch information
Showing
8 changed files
with
286 additions
and
185 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,7 @@ name: CD | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
|
@@ -12,13 +11,14 @@ permissions: | |
|
||
jobs: | ||
check-release-needed: | ||
# Note that `workflow_dispatch` is never skipped | ||
# 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: | ||
- name: nop | ||
run: true | ||
|
||
|
||
build-linux: | ||
needs: [ check-release-needed ] | ||
runs-on: ubuntu-latest | ||
|
@@ -55,34 +55,36 @@ jobs: | |
|
||
build-freebsd: | ||
needs: [ check-release-needed ] | ||
runs-on: macos-12 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install fpm && Build package | ||
uses: vmactions/freebsd-vm@v0 | ||
uses: vmactions/freebsd-vm@v1 | ||
with: | ||
usesh: true | ||
prepare: | | ||
set -e | ||
echo "::group::Install basic packages" | ||
pkg install -y git gmake || exit 1 | ||
pkg install -y git gmake | ||
echo "::endgroup::" | ||
# fpm | ||
echo "::group::Install fpm: Actually install fpm" | ||
pkg install -y devel/ruby-gems || exit 1 | ||
gem install --no-document fpm || exit 1 | ||
pkg install -y devel/ruby-gems | ||
gem install --no-document fpm | ||
echo "::endgroup::" | ||
echo "::group::Install fpm: Install gtar (workaround for https://github.com/jordansissel/fpm/pull/1922)" | ||
pkg install -y gtar || exit 1 | ||
mv /usr/bin/tar /usr/bin/bsdtar || exit 1 | ||
mv /usr/local/bin/gtar /usr/bin/tar || exit 1 | ||
pkg install -y gtar | ||
mv /usr/bin/tar /usr/bin/bsdtar | ||
mv /usr/local/bin/gtar /usr/bin/tar | ||
echo "::endgroup::" | ||
# /fpm | ||
echo "::group::Ignore ownership issues" | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" || exit 1 | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
echo "::endgroup::" | ||
run: | | ||
set -e | ||
|
@@ -106,23 +108,24 @@ jobs: | |
usesh: true | ||
prepare: | | ||
set -e | ||
export PATH="/usr/sbin:$PATH" # Add 'pkg_*' commands to path | ||
echo "::group::Install basic packages" | ||
pkg_add git gmake mozilla-rootcerts-openssl || exit 1 | ||
pkg_add git gmake mozilla-rootcerts-openssl | ||
echo "::endgroup::" | ||
echo "::group::Install fpm" | ||
pkg_add ruby | ||
/usr/pkg/bin/gem install --no-document fpm | ||
pkg_add pkg_install # This is necessary to make `fpm` work with `pkgin` format for some reason | ||
pkg_add pkg_install # This is necessary to make 'fpm' work with 'pkgin' format for some reason | ||
echo "::endgroup::" | ||
echo "::group::Ignore ownership issues" | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
echo "::endgroup::" | ||
run: | | ||
set -e | ||
export PATH="/usr/sbin:$PATH" # Add `pkg_*` commands to path | ||
export PATH="/usr/sbin:$PATH" # Add 'pkg_*' commands to path | ||
gmake dist/netbsd | ||
- name: Upload built package | ||
|
@@ -133,12 +136,12 @@ jobs: | |
|
||
build-openbsd: | ||
needs: [ check-release-needed ] | ||
runs-on: macos-12 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install fpm && Build package | ||
uses: vmactions/openbsd-vm@v0 | ||
uses: vmactions/openbsd-vm@v1 | ||
with: | ||
usesh: true | ||
prepare: | | ||
|
@@ -151,7 +154,7 @@ jobs: | |
echo "::group::Install fpm" | ||
pkg_add "$(pkg_info -Q ruby | grep "^ruby-[0-9]" | tail -n 1)" | ||
/usr/local/bin/gem* install --no-document fpm | ||
ln -s /usr/local/bin/fpm* /usr/local/bin/fpm # Symlink `fpm` to latest version | ||
ln -s /usr/local/bin/fpm* /usr/local/bin/fpm # Symlink 'fpm' to latest version | ||
echo "::endgroup::" | ||
echo "::group::Ignore ownership issues" | ||
|
@@ -196,6 +199,55 @@ jobs: | |
body_path: RELEASE_NOTES.md | ||
files: mommy* | ||
|
||
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 | ||
- name: Checkout apt-mommy | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: fwdekker/apt-mommy | ||
token: ${{ secrets.personal_access_token }} | ||
- name: Extract version number | ||
run: echo "MOMMY_VERSION=v$(head -n 1 ./mommy/version)" >> $GITHUB_ENV | ||
- 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 | ||
run: | | ||
echo "::group::Copy .deb into apt-mommy" | ||
cp *.deb apt-mommy/deb/ | ||
echo "::endgroup::" | ||
echo "::group::Update repo" | ||
cd apt-mommy/ | ||
./update.sh | ||
cd ../ | ||
echo "::endgroup::" | ||
echo "::group::Commit update" | ||
cd apt-mommy/ | ||
git add --all | ||
git config --global user.name "FWDekkerBot" | ||
git config --global user.email "[email protected]" | ||
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::" | ||
release-aur: | ||
needs: [ release-mommy ] | ||
runs-on: ubuntu-latest | ||
|
@@ -264,7 +316,6 @@ jobs: | |
sudo -u build git push origin master dev | ||
echo "::endgroup::" | ||
release-homebrew: | ||
needs: [ release-mommy ] | ||
runs-on: ubuntu-latest | ||
|
Oops, something went wrong.