Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #39 from vincent-herlemont/azure-pipelines
Browse files Browse the repository at this point in the history
Set up CI with Azure Pipelines
  • Loading branch information
vincent-herlemont authored Aug 13, 2020
2 parents 58096a7 + 3597d26 commit 911f5a5
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
100 changes: 100 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
trigger: none
pr: none

pool:
vmImage: 'ubuntu-latest'

jobs:
- job: detect_release
steps:
- bash: |
version=$(curl -s -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/vincent-herlemont/short/releases/latest" | \
jq -r .tag_name | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')
echo "##vso[task.setvariable variable=version;isOutput=true]$version"
name: github
- bash: |
version=$(cargo metadata --no-deps --format-version 1 --manifest-path Cargo.toml \
| jq -r '.packages[] | select(.name | test("short")) | .version')
echo "##vso[task.setvariable variable=version;isOutput=true]$version"
name: cargo
- bash: |
echo github_version : {$(github.version)}
echo cargo_version : {$(cargo.version)}
- job: github_release
variables:
cargo_version: $[ dependencies.detect_release.outputs['cargo.version'] ]
dependsOn: detect_release
condition: and(succeeded('detect_release'), ne(dependencies.detect_release.outputs['github.version'], dependencies.detect_release.outputs['cargo.version']))
steps:
- task: GitHubRelease@1
inputs:
gitHubConnection: 'github.com_vincent-herlemont'
repositoryName: 'vincent-herlemont/short'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: 'v$(cargo_version)'
title: 'v$(cargo_version)'
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'

- job: cargo_release
dependsOn: [ github_release ]
condition: succeeded('github_release')
steps:
- bash: |
cargo publish --locked --dry-run
- job: arch_linux_release
variables:
cargo_version: $[ dependencies.detect_release.outputs['cargo.version'] ]
dependsOn: [ detect_release, cargo_release ]
condition: succeeded('cargo_release')
container: vincentherl/archlinux_azure_pipelines:latest
steps:
- task: DownloadSecureFile@1
name: aurCertificate
inputs:
secureFile: aur

- bash: |
set -e
cd ~
mkdir .ssh
sudo cp $(aurCertificate.secureFilePath) .ssh/
sudo chown vsts_azpcontainer:vsts_azpcontainer .ssh/aur
sudo chmod 600 .ssh/aur
cat <<DOC >> .ssh/config
Host aur.archlinux.org
HostName aur.archlinux.org
User git
AddKeysToAgent yes
IdentityFile ~/.ssh/aur
DOC
echo $(aur_known_hosts_entry) >> .ssh/known_hosts
echo .ssh/known_hosts
cat .ssh/known_hosts
echo .ssh/config
cat .ssh/config
tree -a
ls -al .ssh/
echo Arch linux release
git clone ssh://aur@aur.archlinux.org/short-git.git
cd short-git
makepkg -do
makepkg --printsrcinfo > .SRCINFO
git config --global user.email "$(git_user_email)"
git config --global user.name "$(git_user_name)"
git add PKGBUILD
git add .SRCINFO
git commit -m "release v$(cargo_version)"
git log -p -1
git push origin --dry-run
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
)
[![linux](https://github.com/vincent-herlemont/short/workflows/linux/badge.svg)](https://github.com/vincent-herlemont/short/actions?query=workflow%3Alinux)
[![osx](https://github.com/vincent-herlemont/short/workflows/osx/badge.svg)](https://github.com/vincent-herlemont/short/actions?query=workflow%3Aosx)
[![azure releases](https://img.shields.io/azure-devops/build/vincentherlemont/short_deploy/1/master?label=releases&logo=azure-pipelines)](https://dev.azure.com/vincentherlemont/short_deploy/_build?definitionId=1)
[![dicord](https://img.shields.io/static/v1?label=join&message=Discord&color=7289da&&logo=Discord)](https://discord.gg/AnVYgJM)

> A concise cli launcher / project manager using env files.
The main goal it's readability and time saving with commands use in your project.
Expand Down

0 comments on commit 911f5a5

Please sign in to comment.