This commit is contained in:
CrazyMax 2019-09-20 22:31:47 +02:00
parent 42209d2c11
commit 04ed112080
5 changed files with 4 additions and 41 deletions

View File

@ -1,5 +1,5 @@
[![GitHub release](https://img.shields.io/github/release/crazy-max/ghaction-goreleaser.svg?style=flat-square)](https://github.com/crazy-max/ghaction-goreleaser/releases/latest)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-goreleaser-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/goreleaser)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-goreleaser--action-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/goreleaser-action)
[![Test workflow](https://github.com/crazy-max/ghaction-goreleaser/workflows/test/badge.svg)](https://github.com/crazy-max/ghaction-goreleaser/actions)
[![Support me on Patreon](https://img.shields.io/badge/donate-patreon-f96854.svg?logo=patreon&style=flat-square)](https://www.patreon.com/crazymax)
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/crazyws)

View File

@ -1,5 +1,5 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: 'GoReleaser'
name: 'GoReleaser Action'
description: 'GitHub Action for GoReleaser, a release automation tool for Go projects'
author: 'crazy-max'
branding:

View File

@ -1,37 +0,0 @@
"use strict";
var GitHubApi = require('github');
var semver = require('semver');
module.exports = function (user, repo, opts) {
opts = opts || {};
return new Promise(function (resolve, reject) {
var github = new GitHubApi({
// debug: true,
protocol: 'https',
host: 'api.github.com',
headers: {
'user-agent': 'http://npmjs.com/package/latest-github-tag' // required, can be whatever
},
timeout: opts.timeout || 5000
});
if (opts.auth) {
github.authenticate(opts.auth);
}
github.repos.getTags({
user: user,
repo: repo
}, function (err, tags) {
if (err) {
return reject(err);
}
if (!tags.length) {
return reject(new Error('No tags found for ' + user + '/' + repo));
}
var tagsSorted = tags.map(function (item) {
return item.name;
})
.filter(semver.valid)
.sort(semver.rcompare);
resolve(tagsSorted[0]);
});
});
};

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{
"name": "goreleaser",
"name": "goreleaser-action",
"requires": true,
"lockfileVersion": 1,
"dependencies": {

View File

@ -1,5 +1,5 @@
{
"name": "goreleaser",
"name": "goreleaser-action",
"description": "GitHub Action for GoReleaser, a release automation tool for Go projects",
"main": "lib/main.js",
"directories": {