Skip to content

Commit

Permalink
fix: 50 - actually default version to latest (#56)
Browse files Browse the repository at this point in the history
* fix: actually default version to latest

* test: add CI for latest

* refactor: simplify test workflow
  • Loading branch information
dsaltares authored Apr 20, 2023
1 parent 3942ce8 commit 5a71312
Show file tree
Hide file tree
Showing 5 changed files with 1,804 additions and 1,756 deletions.
82 changes: 0 additions & 82 deletions .github/workflows/demo.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/test-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test download asset

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
download:
strategy:
matrix:
runs-on:
- ubuntu-latest
- macos-latest
- windows-latest

version:
- 'tags/v0.1.18'
- '23960137'
- ''

name: Download
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create a subdirectory
run: |
mkdir subdir
- name: Get a specific version
id: get_release
uses: ./
with:
repo: 'dsaltares/godot-wild-jam-18'
version: ${{ matrix.version }}
file: 'plague-linux.zip'
target: 'subdir/plague-linux.zip'
- name: Display the outputs
run: |
echo "${{ steps.get_release.outputs.version }}"
echo "${{ steps.get_release.outputs.name }}"
echo "${{ steps.get_release.outputs.body }}"
- name: Display the file (Linux, Mac)
run: ls -l subdir/plague-linux.zip
if: matrix.runs-on != 'windows-latest'
- name: Display the file (Windows)
run: dir subdir/plague-linux.zip
if: matrix.runs-on == 'windows-latest'
22 changes: 11 additions & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,9 @@ var require_file_command = __commonJS({
}
});

// node_modules/@actions/http-client/lib/proxy.js
// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js
var require_proxy = __commonJS({
"node_modules/@actions/http-client/lib/proxy.js"(exports) {
"node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkBypass = exports.getProxyUrl = void 0;
Expand Down Expand Up @@ -986,9 +986,9 @@ var require_tunnel2 = __commonJS({
}
});

// node_modules/@actions/http-client/lib/index.js
// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js
var require_lib = __commonJS({
"node_modules/@actions/http-client/lib/index.js"(exports) {
"node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports) {
"use strict";
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k, k2) {
if (k2 === void 0)
Expand Down Expand Up @@ -1538,9 +1538,9 @@ var require_lib = __commonJS({
}
});

// node_modules/@actions/http-client/lib/auth.js
// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js
var require_auth = __commonJS({
"node_modules/@actions/http-client/lib/auth.js"(exports) {
"node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports) {
"use strict";
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
function adopt(value) {
Expand Down Expand Up @@ -2232,9 +2232,9 @@ var require_context = __commonJS({
}
});

// node_modules/@actions/github/node_modules/@actions/http-client/proxy.js
// node_modules/@actions/http-client/proxy.js
var require_proxy2 = __commonJS({
"node_modules/@actions/github/node_modules/@actions/http-client/proxy.js"(exports) {
"node_modules/@actions/http-client/proxy.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getProxyUrl(reqUrl) {
Expand Down Expand Up @@ -2286,9 +2286,9 @@ var require_proxy2 = __commonJS({
}
});

// node_modules/@actions/github/node_modules/@actions/http-client/index.js
// node_modules/@actions/http-client/index.js
var require_http_client = __commonJS({
"node_modules/@actions/github/node_modules/@actions/http-client/index.js"(exports) {
"node_modules/@actions/http-client/index.js"(exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var http3 = require("http");
Expand Down Expand Up @@ -13854,7 +13854,7 @@ var filterByRegex = (file) => (asset) => new RegExp(file).test(asset.name);
var main = async () => {
const { owner, repo } = getRepo(core.getInput("repo", { required: false }), github.context);
const token = core.getInput("token", { required: false });
const version = core.getInput("version", { required: false });
const version = core.getInput("version", { required: false }) || "latest";
const inputTarget = core.getInput("target", { required: false });
const file = core.getInput("file", { required: true });
const usesRegex = core.getBooleanInput("regex", { required: false });
Expand Down
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const printOutput = (release: GetReleaseResult): void => {

const filterByFileName = (file: string) => (asset: Asset) =>
file === asset.name;

const filterByRegex = (file: string) => (asset: Asset) =>
new RegExp(file).test(asset.name);

Expand All @@ -131,7 +132,7 @@ const main = async (): Promise<void> => {
github.context
);
const token = core.getInput('token', { required: false });
const version = core.getInput('version', { required: false });
const version = core.getInput('version', { required: false }) || 'latest';
const inputTarget = core.getInput('target', { required: false });
const file = core.getInput('file', { required: true });
const usesRegex = core.getBooleanInput('regex', { required: false });
Expand Down
Loading

0 comments on commit 5a71312

Please sign in to comment.