Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare documentation for release #35

Merged
merged 9 commits into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/01-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build-test-run
name: Test

on:
workflow_dispatch:
Expand Down Expand Up @@ -32,6 +32,10 @@ jobs:
id: run_action
with:
draft: true
- uses: deblockt/cucumber-report-annotations-action@v1.9
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
path: "**/cucumber-report.json"

- name: log-action-output
run: echo ${{steps.run_action.outputs.gh_output}}
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:
id: current-version
run: |
echo "::set-output name=version::$(npm pkg get version | xargs)"
- run: npm install
- run: npm run build
- name: test
run: npm run test:coverage
- uses: ./
name: Check if version "${{ steps.current-version.outputs.version }}" is released
id: check-version
Expand All @@ -33,3 +37,17 @@ jobs:
prerelease: ${{ contains(steps.current-version.outputs.version, '-rc') }}
version: ${{ (steps.check-version.outputs.found == 'false' && steps.current-version.outputs.version) || ''}}
tag: v${{ steps.current-version.outputs.version }}
- uses: NBTX/upload-release-assets@v1
if: steps.check-version.outputs.found == 'false'
name: Upload Reports to Release
id: upload-reports
with:
upload_url: ${{ steps.release.outputs.upload_url}}
targets: reports/cucumber.html
- uses: NBTX/upload-release-assets@v1
if: steps.check-version.outputs.found == 'false'
name: Upload Library to Release
id: upload-lib
with:
upload_url: ${{ steps.release.outputs.upload_url}}
targets: lib/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,4 @@ modules.xml
!dist/
links
lib/
reports/
6 changes: 5 additions & 1 deletion .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
"all": true,
"include": [
"src/**/*.ts"
]
],
"reporter": [
"text-summary"
],
"report-dir": "./reports/coverage"
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Github Workflows and Actions
Copyright (c) 2022-Present Boite.nl and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
37 changes: 0 additions & 37 deletions Makefile

This file was deleted.

55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
# Query Github Releases Action

![Test](https://github.com/boite-nl/query-release-action/actions/workflows/01-build.yml/badge.svg?branch=main)


Github Action to Query Github releases and retrieve information about this release which can be used in other actions.

## Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Action](#action)
- [Inputs](#inputs)
- [Environment Variables](#environment-variables)
- [Outputs](#outputs)
- [Runs](#runs)
- [Examples](#examples)
- [Deploy specific release to environment](#deploy-specific-release-to-environment)
- [Rollback action](#rollback-action)
- [Query Github Releases Action](#query-github-releases-action)
- [Contents](#contents)
- [Action](#action)
- [Inputs](#inputs)
- [Environment Variables](#environment-variables)
- [Outputs](#outputs)
- [Runs](#runs)
- [Examples](#examples)
- [Deploy specific release to environment](#deploy-specific-release-to-environment)
- [Rollback action](#rollback-action)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Action
<!-- action-docs-inputs -->
### Inputs

| parameter | description | required | default |
| - | - | - | - |
| token | Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. | `false` | ${{ github.token }} |
| draft | Get Draft Release | `false` | false |
| exclude-draft | Exclude Draft Releases | `false` | |
| prerelease | Get Prerelease | `false` | false |
| range | Get Semver Versions from within a specific Range | `false` | |
| release | Get Release | `false` | false |
| select | Which release do you want to retrieve? (latest, previous, oldest, max, min, specific release) | `false` | latest |
| parameter | description | required | default |
| ------------- | --------------------------------------------------------------------------------------------- | -------- | ------------------- |
| token | Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. | `false` | ${{ github.token }} |
| draft | Get Draft Release | `false` | false |
| exclude-draft | Exclude Draft Releases | `false` | |
| prerelease | Get Prerelease | `false` | false |
| range | Get Semver Versions from within a specific Range | `false` | |
| release | Get Release | `false` | false |
| select | Which release do you want to retrieve? (latest, previous, oldest, max, min, specific release) | `false` | latest |



Expand All @@ -40,14 +45,14 @@ Github Action to Query Github releases and retrieve information about this relea
<!-- action-docs-outputs -->
### Outputs

| parameter | description |
| - | - |
| found | A release is found |
| id | The Release ID |
| name | The name for the release |
| tag_name | The tag name for the release |
| body | Description of the Release |
| url | The URL of the Release |
| parameter | description |
| --------- | ---------------------------- |
| found | A release is found |
| id | The Release ID |
| name | The name for the release |
| tag_name | The tag name for the release |
| body | Description of the Release |
| url | The URL of the Release |



Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Query Github Releases'
description: 'Query Github Releases'
description: 'Query Github releases and retrieve information about this release which can be used in other actions'
author: Boite Witte <info@boite.nl>

runs:
Expand Down
8 changes: 7 additions & 1 deletion cucumber-config/acceptance.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ module.exports = {
token: 'test-token',
repo: 'release-query',
owner: 'github-actions'
}
},
format: [
'summary',
'html:reports/cucumber.html',
'message:reports/cucumber-messages.json',
'json:reports/cucumber-report.json'
]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"pack": "tsc --noEmit && ncc build src/index.ts --out lib/ --license license -s --no-source-map-register",
"snippits:acceptance": "npx cucumber-js --config cucumber-config/acceptance.js --dry-run --format-options \"{\\\"snippetInterface\\\": \\\"async-await\\\"}\" --format snippets --publish-quiet",
"test": "npm run test:acceptance",
"test:acceptance": "npx cucumber-js --config cucumber-config/acceptance.js",
"test:acceptance": "mkdir -p reports && npx cucumber-js --config cucumber-config/acceptance.js",
"test:coverage": "npx nyc npm test",
"preversion": "npm test && rm -rf ./dist/* && touch ./dist/.gitkeep",
"version": "npm run build && action-docs --toc-level 3 --update-readme --no-banner && doctoc README.md && git add -A dist README.md"
Expand Down
1 change: 1 addition & 0 deletions step-definitions/acceptance/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default class ReleaseWorld extends GithubWorld {

setReleases(data: Releases): Releases {
this.releases = data
this.attach(JSON.stringify(this.releases), 'application/json')
this.mockRequest('get', `/repos/${this.owner}/${this.repo}/releases`, 200, data)
return data
}
Expand Down