A cli tool to upload an artifact to a tangled repo, mainly during spindle workflows
ci artifact spindle

Major : first release

+88 -16
+62
.tangled/workflows/next-tag.yml
··· 1 + when: 2 + - event: ["push", "manual"] 3 + branch: ["main"] 4 + 5 + engine: nixery 6 + 7 + dependencies: 8 + nixpkgs: 9 + - semver-tool 10 + - openssh 11 + 12 + steps: 13 + - name: Setup user 14 + command: | 15 + echo "root:x:0:0::$HOME:/usr/bin/bash" >> /etc/passwd 16 + 17 + - name: Setup SSH 18 + command: | 19 + mkdir -p $HOME/.ssh 20 + echo "-----BEGIN OPENSSH PRIVATE KEY-----" > $HOME/.ssh/privkey 21 + echo $SSH_KEY >> $HOME/.ssh/privkey 22 + echo "-----END OPENSSH PRIVATE KEY-----" >> $HOME/.ssh/privkey 23 + chmod 600 $HOME/.ssh/privkey 24 + 25 + - name: Setup SSH repo 26 + command: | 27 + git config --global user.email "evann.regnault@pm.me" 28 + git config --global user.name "Evann Regnault" 29 + URL=$(git remote get-url origin) 30 + REPO=${URL#*//*/} 31 + git remote set-url origin "git@tangled.org:"$REPO 32 + 33 + - name: Next tag 34 + command: | 35 + TAG=$(git tag | tac | head -1) 36 + 37 + if [ "$TAG" == "" ]; then 38 + TAG="0.0.0" 39 + fi 40 + 41 + COMMIT=$(git log -1 --pretty=%B) 42 + 43 + case "${COMMIT^^}" in 44 + MAJOR*) TYPE="major" ;; 45 + MINOR*) TYPE="minor" ;; 46 + PATCH*) TYPE="patch" ;; 47 + *) TYPE="" ;; 48 + esac 49 + 50 + if [ $TYPE != "" ]; then 51 + semver bump $TYPE $TAG > tag 52 + fi 53 + 54 + - name: Push new tag 55 + environment: 56 + GIT_SSH_COMMAND: "ssh -i $HOME/.ssh/privkey -o IdentitiesOnly=yes" 57 + command: | 58 + if [ -f "tag" ]; then 59 + TAG=$(cat tag) 60 + git tag -a $TAG -m "Release $TAG" 61 + git push --tags 62 + fi
+26
.tangled/workflows/release.yml
··· 1 + when: 2 + - event: ["push"] 3 + tag: ["*"] 4 + 5 + engine: nixery 6 + 7 + dependencies: 8 + nixpkgs: 9 + - go 10 + - semver-tool 11 + 12 + # custom registry 13 + git+https://tangled.org/regnault.dev/spindle-artifact: 14 + - spindle-artifact 15 + 16 + steps: 17 + - name: Build 18 + command: | 19 + TAG=$(git tag | tac | head -1) 20 + go build . 21 + mv spindle-artifact spindle-artifact-$TAG 22 + 23 + - name: Upload artifact 24 + command: | 25 + TAG=$(git tag | tac | head -1) 26 + ~/.nix-profile/bin/spindle-artifact spindle-artifact $TAG spindle-artifact-$TAG
-16
.tangled/workflows/test.yml
··· 1 - when: 2 - - event: ["push", "manual"] 3 - branch: ["main"] 4 - 5 - engine: nixery 6 - 7 - dependencies: 8 - # custom registry 9 - git+https://tangled.org/regnault.dev/spindle-artifact: 10 - - spindle-artifact 11 - 12 - steps: 13 - - name: Upload file 14 - command: | 15 - echo "a" > a.txt 16 - ~/.nix-profile/bin/spindle-artifact webfishing-macos-atproto 1.0 a.txt