diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index abfa856b..6ece4578 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -14,12 +14,24 @@ 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: @@ -27,4 +39,4 @@ jobs: committer_email: actions@github.com add: . message: 'update files' - tag_push: '--force' \ No newline at end of file + push: '--force' \ No newline at end of file diff --git a/TEMPLATE.md b/TEMPLATE.md index 281b7c1c..e993a15d 100644 --- a/TEMPLATE.md +++ b/TEMPLATE.md @@ -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: ``` de.staticred.kia kia - [vidl {{ VIDL_RELEASE_TAG }}] + $VERSION ```