Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
Signed-off-by: Vinicius Tinti <viniciustinti@gmail.com>
tinti committed Jan 15, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 88abe22 + 87fcfbf commit 7b70a86
Showing 8 changed files with 81 additions and 42 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Docker CI build
name: Build
# This workflow is triggered on pushes to the repository.
on:
push:
paths-ignore:
- 'doc/**'
- 'completions/**'
- 'README.md'
- '.gitignore'
pull_request:

jobs:
81 changes: 61 additions & 20 deletions .github/workflows/docker-multiarch-tag.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,58 @@
name: Multiarch build and release
name: Release
on:
push:
tags:
- v**
branches:
- master


jobs:
tag:
name: Tag release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: mathieudutour/github-tag-action@v3
id: tag_version
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag_prefix: 'v'
- name: share variables
shell: bash
run: |
mkdir env
echo ${{ steps.tag_version.outputs.new_version }} > env/new_version
echo ${{ steps.tag_version.outputs.new_tag }} > env/new_tag
echo ${{ steps.tag_version.outputs.previous_tag }} > env/previous_tag
- uses: actions/upload-artifact@v1
with:
name: env
path: env
build-releases:
strategy:
matrix:
arch: ['x86_64', 'armv7h', 'aarch64']
name: Build ${{ matrix.arch }}
runs-on: ubuntu-latest
needs: [tag]
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Set version
id: set_version
run: ./testdata/ci/version.sh
uses: actions/checkout@v1
- uses: actions/download-artifact@v1
with:
name: env
- name: Read info
id: tags
shell: bash
run: |
echo ::set-output name=VERSION::$(cat env/new_version)
- name: Install dependencies
run: sudo apt update -y && sudo apt install -y qemu qemu-user-static
- name: Setup qemu-user-static
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build ${{ matrix.arch }} release
run: |
mkdir artifacts
make docker-release ARCH=${{ matrix.arch }} VERSION=${{ steps.set_version.outputs.version }}
make docker-release ARCH=${{ matrix.arch }} VERSION=${{ steps.tags.outputs.version }}
mv *.tar.gz artifacts
- uses: actions/upload-artifact@master
with:
@@ -37,9 +65,20 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master
- uses: actions/download-artifact@v1
with:
name: env
- name: Read info
id: tags
shell: bash
run: |
echo ::set-output name=VERSION::$(cat env/new_version)
echo ::set-output name=TAG::$(cat env/new_tag)
echo ::set-output name=PREV_TAG::$(cat env/previous_tag)
- name: Set version
id: set_version
run: ./testdata/ci/version.sh
id: changelog
shell: bash
run: ./testdata/ci/changelog.sh $(cat env/previous_tag)
- uses: actions/download-artifact@master
with:
name: yay_x86_64
@@ -55,10 +94,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.set_version.outputs.version }}
release_name: ${{ steps.set_version.outputs.version }}
body: "## Changelog"
draft: true
tag_name: ${{ steps.tags.outputs.tag }}
release_name: ${{ steps.tags.outputs.tag }}
body: |
## Changelog
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Upload x86_64 asset
id: upload-release-asset-x86_64
@@ -67,8 +108,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yay_x86_64/yay_${{ steps.set_version.outputs.version }}_x86_64.tar.gz
asset_name: yay_${{ steps.set_version.outputs.version }}_x86_64.tar.gz
asset_path: ./yay_x86_64/yay_${{ steps.tags.outputs.version }}_x86_64.tar.gz
asset_name: yay_${{ steps.tags.outputs.version }}_x86_64.tar.gz
asset_content_type: application/tar+gzip
- name: Upload armv7h asset
id: upload-release-asset-armv7h
@@ -77,8 +118,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yay_armv7h/yay_${{ steps.set_version.outputs.version }}_armv7h.tar.gz
asset_name: yay_${{ steps.set_version.outputs.version }}_armv7h.tar.gz
asset_path: ./yay_armv7h/yay_${{ steps.tags.outputs.version }}_armv7h.tar.gz
asset_name: yay_${{ steps.tags.outputs.version }}_armv7h.tar.gz
asset_content_type: application/tar+gzip
- name: Upload aarch64 asset
id: upload-release-asset-aarch64
@@ -87,6 +128,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./yay_aarch64/yay_${{ steps.set_version.outputs.version }}_aarch64.tar.gz
asset_name: yay_${{ steps.set_version.outputs.version }}_aarch64.tar.gz
asset_path: ./yay_aarch64/yay_${{ steps.tags.outputs.version }}_aarch64.tar.gz
asset_name: yay_${{ steps.tags.outputs.version }}_aarch64.tar.gz
asset_content_type: application/tar+gzip
13 changes: 7 additions & 6 deletions config.go
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ type Configuration struct {
LowPriority bool `json:"lowpriority"`
}

var version = "9.4.2"
var version = "9.4.3"

// configFileName holds the name of the config file.
const configFileName string = "config.json"
@@ -127,18 +127,19 @@ var hideMenus = false

// SaveConfig writes yay config to file.
func (config *Configuration) saveConfig() error {
marshalledinfo, _ := json.MarshalIndent(config, "", "\t")
marshalledinfo, err := json.MarshalIndent(config, "", "\t")
if err != nil {
return err
}
in, err := os.OpenFile(configFile, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
return err
}
defer in.Close()
_, err = in.Write(marshalledinfo)
if err != nil {
if _, err = in.Write(marshalledinfo); err != nil {
return err
}
err = in.Sync()
return err
return in.Sync()
}

func defaultSettings() *Configuration {
2 changes: 1 addition & 1 deletion download.go
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ func gitDownloadABS(url string, path string, name string) (bool, error) {
return false, fmt.Errorf("error reading %s", filepath.Join(path, name, ".git"))
}

cmd := passToGit(filepath.Join(path, name), "fetch")
cmd := passToGit(filepath.Join(path, name), "pull", "--ff-only")
cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0")
_, stderr, err := capture(cmd)
if err != nil {
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/Jguer/yay/v9

require (
github.com/Jguer/go-alpm v0.0.0-20191021114528-e11e8a60f385
github.com/Jguer/go-alpm v0.0.0-20191122171459-5cffc6e8fc69
github.com/Morganamilo/go-pacmanconf v0.0.0-20180910220353-9c5265e1b14f
github.com/Morganamilo/go-srcinfo v1.0.0
github.com/mikkeloscar/aur v0.0.0-20190912174111-183f80a38525
github.com/mikkeloscar/aur v0.0.0-20191216074712-ebecb34b95b4
)

go 1.13
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/Jguer/go-alpm v0.0.0-20191021114528-e11e8a60f385 h1:zbR80csn6BWooOwjFjUHzIKVgrtg5EN3Qp4cvYlPTYw=
github.com/Jguer/go-alpm v0.0.0-20191021114528-e11e8a60f385/go.mod h1:D5SUcIS9Yiz/L8cjRzq/992eERnx6ugYmGlc4e7xdus=
github.com/Jguer/go-alpm v0.0.0-20191122171459-5cffc6e8fc69 h1:eNGutt8eUr37crjH7Wpvg5rTNk71hoBEXUpyJA0oheU=
github.com/Jguer/go-alpm v0.0.0-20191122171459-5cffc6e8fc69/go.mod h1:D5SUcIS9Yiz/L8cjRzq/992eERnx6ugYmGlc4e7xdus=
github.com/Morganamilo/go-pacmanconf v0.0.0-20180910220353-9c5265e1b14f h1:ptFKynTV1p8JCzqk81NcMj0DV0Xle+PdKxfHjPbdIOU=
github.com/Morganamilo/go-pacmanconf v0.0.0-20180910220353-9c5265e1b14f/go.mod h1:Hk55m330jNiwxRodIlMCvw5iEyoRUCIY64W1p9D+tHc=
github.com/Morganamilo/go-srcinfo v1.0.0 h1:Wh4nEF+HJWo+29hnxM18Q2hi+DUf0GejS13+Wg+dzmI=
github.com/Morganamilo/go-srcinfo v1.0.0/go.mod h1:MP6VGY1NNpVUmYIEgoM9acix95KQqIRyqQ0hCLsyYUY=
github.com/mikkeloscar/aur v0.0.0-20190912174111-183f80a38525 h1:T0cWcTw55+0h3bEBHWkDPEKYutNIksrDU4aJfkBJTpo=
github.com/mikkeloscar/aur v0.0.0-20190912174111-183f80a38525/go.mod h1:nYOKcK8tIj69ZZ8uDOWoiT+L25NvlOQaraDqTec/idA=
github.com/mikkeloscar/aur v0.0.0-20191216074712-ebecb34b95b4 h1:qPyKOVOjHT0dJOS3FFYQzXTOa9gyDOL7CnjCWltkYtM=
github.com/mikkeloscar/aur v0.0.0-20191216074712-ebecb34b95b4/go.mod h1:nYOKcK8tIj69ZZ8uDOWoiT+L25NvlOQaraDqTec/idA=
3 changes: 3 additions & 0 deletions testdata/ci/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo "::set-output name=CHANGELOG::$(git log --pretty=format:'%s%n%b==============================================' --abbrev-commit $1..$2)"
7 changes: 0 additions & 7 deletions testdata/ci/version.sh

This file was deleted.

0 comments on commit 7b70a86

Please sign in to comment.