finish restructure of the CI pipelines
This commit is contained in:
parent
b3959782b1
commit
889295fd58
|
@ -93,13 +93,13 @@ release:
|
|||
assets:
|
||||
links:
|
||||
- name: 'Any linux binary'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz'
|
||||
- name: 'Any linux binary sha256 sum'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz.sum'
|
||||
- name: 'Debian archive'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG}_amd64.deb'
|
||||
- name: 'Debian archive sha256 sum'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum'
|
||||
url: '${PACKAGE_REGISTRY_URL}/tiempo_${CI_COMMIT_TAG}_amd64.deb.sum'
|
||||
|
||||
deploy:arch-bin:
|
||||
stage: aur
|
||||
|
@ -113,8 +113,17 @@ deploy:arch-bin:
|
|||
# setup git, because we'll commit
|
||||
- git config --global user.name "$COMMITER_NAME"
|
||||
- git config --global user.email "$COMMITER_EMAIL"
|
||||
# finally run the script
|
||||
# Clone the repo
|
||||
- git clone $BIN_REPO_URL $PROJECT_NAME-bin
|
||||
# generate the PKGBUILD in the current directory
|
||||
- scripts/release-aur-bin.sh
|
||||
- mv PKGBUILD $PROJECT_NAME-bin/
|
||||
- mv .SRCINFO $PROJECT_NAME-bin/
|
||||
# commit
|
||||
- cd $PROJECT_NAME-bin
|
||||
- git add .
|
||||
- git commit -m "Release version $CI_COMMIT_TAG"
|
||||
- git push
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
when: never
|
||||
|
@ -132,8 +141,17 @@ deploy:arch-git:
|
|||
# setup git, because we'll commit
|
||||
- git config --global user.name "$COMMITER_NAME"
|
||||
- git config --global user.email "$COMMITER_EMAIL"
|
||||
# clone the repo
|
||||
- git clone $GIT_REPO_URL $PROJECT_NAME-git
|
||||
# finally run the script
|
||||
- scripts/release-aur-git.sh
|
||||
- mv PKGBUILD $PROJECT_NAME-bin/
|
||||
- mv .SRCINFO $PROJECT_NAME-bin/
|
||||
# and commit
|
||||
- cd $PROJECT_NAME-bin
|
||||
- git add .
|
||||
- git commit -m "Release version $VERSION"
|
||||
- git push
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH
|
||||
when: never
|
||||
|
|
13
README.md
13
README.md
|
@ -119,9 +119,18 @@ Or build it yourself from this repo:
|
|||
|
||||
podman build -t tiempo-build-env .
|
||||
|
||||
Then build the packages:
|
||||
Then build the artifacts:
|
||||
|
||||
podman run -it --rm -w /app -v ./:/app -e CI_COMMIT_TAG=v2.0.0 tiempo-build-env ./scripts/build.sh
|
||||
podman run -it --rm -w /app -v ./:/app -v tiempo_cargo_index:/usr/local/cargo/registry -e CI_COMMIT_TAG=v1.6rc8 tiempo-build-env ./scripts/build.sh
|
||||
|
||||
To build the archlinux PKGBUILDs (depends on the artifacts folder created by the
|
||||
previous command):
|
||||
|
||||
podman run -it --rm -w /app -v ./:/app:rw -e CI_COMMIT_TAG=v1.6rc8 -e CI_PROJECT_ID=27545092 --uidmap 1000:0:1 --uidmap 0:1:1000 categulario/makepkg ./scripts/release-aur-bin.sh
|
||||
podman run -it --rm -w /app -v ./:/app:rw -e CI_COMMIT_TAG=v1.6rc8 --uidmap 1000:0:1 --uidmap 0:1:1000 categulario/makepkg ./scripts/release-aur-git.sh
|
||||
|
||||
Both of the previous commands produce PKGBUILDs in the current directory so if
|
||||
you run both sequentially you'll lose the PKGBUILD of the first command.
|
||||
|
||||
## Special Thanks
|
||||
|
||||
|
|
|
@ -15,29 +15,28 @@ cargo clippy --all-targets --all-features -- -D warnings
|
|||
cargo test
|
||||
cargo build --locked --release
|
||||
|
||||
# create the tar package
|
||||
mkdir -p build/bin build/share/doc/tiempo build/share/man/man1 build/share/bash-completion/completions build/share/zsh/site-functions build/share/fish/vendor_completions.d
|
||||
# move binary
|
||||
cp target/release/t build/bin/
|
||||
install -m 755 -D target/release/t build/bin/t
|
||||
# move documentation
|
||||
cp CHANGELOG.md build/share/doc/tiempo/
|
||||
cp README.md build/share/doc/tiempo/
|
||||
cp LICENSE build/share/doc/tiempo/
|
||||
install -m 644 -D CHANGELOG.md build/share/doc/tiempo/CHANGELOG.md
|
||||
install -m 644 -D README.md build/share/doc/tiempo/README.md
|
||||
install -m 644 -D LICENSE build/share/doc/tiempo/LICENSE
|
||||
# move man page
|
||||
cp docs/build/man/tiempo.1.gz build/share/man/man1/
|
||||
install -m 644 -D docs/build/man/tiempo.1.gz build/share/man/man1/tiempo.1.gz
|
||||
# move completions
|
||||
cp completions/bash/t build/share/bash-completion/completions/
|
||||
cp completions/fish/t.fish build/share/fish/vendor_completions.d/
|
||||
cp completions/zsh/_t build/share/zsh/site-functions/
|
||||
install -m 644 -D completions/bash/t build/share/bash-completion/completions/t
|
||||
install -m 644 -D completions/fish/t.fish build/share/fish/vendor_completions.d/t.fish
|
||||
install -m 644 -D completions/zsh/_t build/share/zsh/site-functions/_t
|
||||
|
||||
# compress the tar file
|
||||
tar -cvzf tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz build/
|
||||
tar -cvzf tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz build/
|
||||
# makes the debian archive
|
||||
./scripts/debpackage.sh
|
||||
# computes the sums
|
||||
sha256sum tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz > tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum
|
||||
sha256sum debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb > tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum
|
||||
sha256sum tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz > tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz.sum
|
||||
sha256sum debian-package/tiempo_${CI_COMMIT_TAG}_amd64.deb > tiempo_${CI_COMMIT_TAG}_amd64.deb.sum
|
||||
mkdir -p artifacts
|
||||
mv tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz artifacts/
|
||||
mv debian-package/tiempo_${CI_COMMIT_TAG:1}_amd64.deb artifacts/
|
||||
mv tiempo-${CI_COMMIT_TAG:1}-x86_64.tar.gz.sum artifacts/
|
||||
mv tiempo_${CI_COMMIT_TAG:1}_amd64.deb.sum artifacts/
|
||||
mv tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz artifacts/
|
||||
mv debian-package/tiempo_${CI_COMMIT_TAG}_amd64.deb artifacts/
|
||||
mv tiempo-${CI_COMMIT_TAG}-x86_64.tar.gz.sum artifacts/
|
||||
mv tiempo_${CI_COMMIT_TAG}_amd64.deb.sum artifacts/
|
||||
|
|
|
@ -20,7 +20,6 @@ DPKG_DIR="${DPKG_STAGING}/dpkg"
|
|||
PROJECT_MANTAINER="Abraham Toriz Cruz"
|
||||
PROJECT_HOMEPAGE="https://gitlab.com/categulario/tiempo-rs"
|
||||
PROJECT_NAME=tiempo
|
||||
PROJECT_VERSION=${CI_COMMIT_TAG:1}
|
||||
PROJECT_BINARY=t
|
||||
PROJECT_DESCRIPTION="A command line time tracking application"
|
||||
|
||||
|
@ -28,9 +27,9 @@ mkdir -p "${DPKG_DIR}"
|
|||
|
||||
DPKG_BASENAME=${PROJECT_NAME}
|
||||
DPKG_CONFLICTS=
|
||||
DPKG_VERSION=${PROJECT_VERSION}
|
||||
DPKG_VERSION=${CI_COMMIT_TAG:1}
|
||||
DPKG_ARCH=amd64
|
||||
DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb"
|
||||
DPKG_NAME="${DPKG_BASENAME}_${CI_COMMIT_TAG}_${DPKG_ARCH}.deb"
|
||||
DPKG_DEPENDS=
|
||||
DPKG_SECTION=utils
|
||||
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# some useful variables
|
||||
VERSION=${CI_COMMIT_TAG:1}
|
||||
PROJECT_NAME=tiempo
|
||||
PROJECT_BINARY=t
|
||||
ARCHIVENAME=$PROJECT_NAME-$VERSION-x86_64.tar.gz
|
||||
|
||||
# clone the repo
|
||||
git clone $BIN_REPO_URL $PROJECT_NAME-bin
|
||||
|
||||
# enter it
|
||||
cd $PROJECT_NAME-bin
|
||||
ARCHIVENAME=$PROJECT_NAME-$CI_COMMIT_TAG-x86_64.tar.gz
|
||||
|
||||
# get the sum from the artifacts
|
||||
SUM=( `cat ../artifacts/$ARCHIVENAME.sum` )
|
||||
SUM=( `cat artifacts/$ARCHIVENAME.sum` )
|
||||
|
||||
# Generate the PKGBUILD
|
||||
echo "# Maintainer: Abraham Toriz <categulario at gmail dot com>
|
||||
|
@ -28,7 +24,7 @@ depends=()
|
|||
optdepends=('sqlite: for manually editing the database')
|
||||
provides=('$PROJECT_NAME')
|
||||
conflicts=('$PROJECT_NAME')
|
||||
source=(\"https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/generic/v$VERSION/v$VERSION/$PROJECT_NAME-\${pkgver}-x86_64.tar.gz\")
|
||||
source=(\"https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/generic/$CI_COMMIT_TAG/$CI_COMMIT_TAG/$PROJECT_NAME-\${pkgver}-x86_64.tar.gz\")
|
||||
sha256sums=('$SUM')
|
||||
|
||||
package() {
|
||||
|
@ -46,6 +42,3 @@ package() {
|
|||
" | tee PKGBUILD > /dev/null
|
||||
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
git add .
|
||||
git commit -m "Release version $VERSION"
|
||||
git push
|
||||
|
|
|
@ -5,12 +5,6 @@ VERSION=${CI_COMMIT_TAG:1}
|
|||
PROJECT_NAME=tiempo
|
||||
PROJECT_BINARY=t
|
||||
|
||||
# clone the repo
|
||||
git clone $GIT_REPO_URL $PROJECT_NAME-git
|
||||
|
||||
# enter it
|
||||
cd $PROJECT_NAME-git
|
||||
|
||||
echo "# Maintainer: Abraham Toriz <categulario at gmail dot com>
|
||||
pkgname=$PROJECT_NAME-git
|
||||
pkgver=$VERSION
|
||||
|
@ -55,6 +49,3 @@ package() {
|
|||
}" | tee PKGBUILD > /dev/null
|
||||
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
git add .
|
||||
git commit -m "Release version $VERSION"
|
||||
git push
|
||||
|
|
Loading…
Reference in New Issue