diff options
author | Johan Brandhorst <[email protected]> | 2020-05-09 16:57:27 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2020-07-05 09:51:44 +0200 |
commit | 149c9533e2d2df5b4c67e4af5034afac56d358a0 (patch) | |
tree | df2e722a6a671e65f678911eda80179f93d35bd9 /.circleci | |
parent | a85df334e63883868322fd82bf60cc41e69ba1fc (diff) | |
download | tinygo-149c9533e2d2df5b4c67e4af5034afac56d358a0.tar.gz tinygo-149c9533e2d2df5b4c67e4af5034afac56d358a0.zip |
ci: add archlinux release job
Adds the arch-release job, which automatically updates
the tinygo-bin AUR package on every new git tag with
a semver version.
Diffstat (limited to '.circleci')
-rw-r--r-- | .circleci/config.yml | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index 0530d8e18..280b3e93e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -319,7 +319,53 @@ commands: - ~/.cache/go-build - ~/.cache/tinygo - /go/pkg/mod - + arch-release: + steps: + - run: + name: Install dependencies + command: pacman -Sy --noconfirm openssh git pacman-contrib binutils + - run: + name: Create TinyGo user + command: useradd -m tinygo + - run: + name: Become TinyGo user + command: su tinygo + - run: + name: Start SSH Agent + command: eval $(ssh-agent -s) + - run: + name: Add ARCH_RELEASE_SSH_PRIVATE_KEY identity + command: echo "${ARCH_RELEASE_SSH_PRIVATE_KEY}" | tr -d '\r' | ssh-add - + - run: + name: Create SSH directory + command: mkdir -p ~/.ssh && chmod 700 ~/.ssh + - run: + name: Add aur.archlinux.org to known hosts + command: ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts + - run: + name: Clone tinygo-bin repo + command: git clone ssh://[email protected]/tinygo-bin.git ~/tinygo-bin + - run: + name: Update package version + command: sed -i -E "s/(pkgver=)(.*)$/\1${CIRCLE_TAG}/" ~/tinygo-bin/PKGBUILD + - run: + name: Update file checksums + command: cd ~/tinygo-bin && updpkgsums + - run: + name: Update .SRCINFO + command: cd ~/tinygo-bin && makepkg --printsrcinfo > .SRCINFO + # Commit the update + - run: + name: Set git commit config + command: | + git config --global user.email "[email protected]" && + git config --global user.name "TinyGo Release Bot" + - run: + name: Commit and push changes + command: | + cd ~/tinygo-bin && + git commit -a -m "Update tinygo-bin to v${CIRCLE_TAG}" && + git push origin master jobs: test-llvm9-go111: @@ -361,6 +407,11 @@ jobs: xcode: "10.1.0" steps: - build-macos + arch-release: + docker: + - image: archlinux:latest + steps: + - arch-release @@ -375,3 +426,12 @@ workflows: - build-linux - build-macos - assert-test-linux + release: + jobs: + - arch-release: + filters: + branches: + ignore: /.*/ + tags: + # Runs on every semver release + only: /v[0-9]+(\.[0-9]+)*(-.*)*/ |