Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
StaticFX committed May 11, 2024
1 parent dd603ad commit a10bb9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 41 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,29 @@ jobs:
with:
fetch-depth: 0
ref: master
- name: Generate README.md
uses: probablykasper/readme-template-action@v1
- name: Delete old readme.md
uses: JesseTG/rm@v1.0.3
with:
token: ${{ secrets.JAVA_TOKEN }}
template: TEMPLATE.md
output: README.md
path: readme.md

- name: Copy template to readme.md
uses: canastro/copy-file-action@master
with:
source: "TEMPLATE.md"
target: "readme.md"
- name: Replace variables in readme.md
uses: richardrigutins/replace-in-files@v2
with:
files: 'readme.md'
search-text: '$VERSION'
replacement-text: ${{ github.ref }}
exclude: 'node_modules/**'
encoding: 'utf8'
- name: Push changes
uses: EndBug/add-and-commit@v9
with:
committer_name: GitHub Actions
committer_email: [email protected]
add: .
message: 'update files'
tag_push: '--force'
push: '--force'
36 changes: 1 addition & 35 deletions TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,13 @@
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/staticfx/kia/workflow.yml)
![GitHub Release](https://img.shields.io/github/v/release/staticfx/kia)

```js
module.exports = {
LATEST_VIDL_RELEASE: {
type: 'customQuery',
loop: false,
query: async (octokit, moment, user) => {
// You can do anything you want with the GitHub API here.
const result = await octokit.graphql(`
query {
repository(name: "vidl", owner: "${user.USERNAME}") {
releases(last: 1) {
edges {
node {
url
publishedAt
tagName
}
}
}
}
}
`)
const release = result.repository.releases.edges[0].node
const date = new Date(release.publishedAt)
return {
VIDL_RELEASE_TAG: release.tagName,
VIDL_RELEASE_URL: release.url,
VIDL_RELEASE_WHEN: moment(release.publishedAt).fromNow(),
}
}
}
}
```


Maven:
```
<dependency>
<groupId>de.staticred.kia</groupId>
<artifactId>kia</artifactId>
<version>[vidl {{ VIDL_RELEASE_TAG }}]</version>
<version>$VERSION</version>
</dependency>
```

Expand Down

0 comments on commit a10bb9c

Please sign in to comment.