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

Workflows for creating releases with docs #891

Open
wants to merge 11 commits into
base: v3
Choose a base branch
from
47 changes: 47 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will install Deno then run Deno lint and test.
# For more information see: https://github.com/denoland/setup-deno

name: Push to Docs

on:
push:
tags:
- "effection-v*"

jobs:
release:
runs-on: ubuntu-latest

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: ${{github.ref}}

- name: setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Get Version
id: vars
run: echo ::set-output name=version::$(echo ${{github.ref_name}} | sed 's/^effection-v//')

- name: Generate Docs
run: deno doc --html --name=effection@$VERSION mod.ts
env:
VERSION: ${{steps.vars.outputs.version}}

- run: tar cfv docs.tar -C docs .

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: docs.tar
taras marked this conversation as resolved.
Show resolved Hide resolved
name: ${{steps.vars.outputs.version}}


70 changes: 70 additions & 0 deletions .github/workflows/rebuild-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Push to Docs

on:
workflow_dispatch:

jobs:
setup:
runs-on: ubuntu-latest
outputs:
tags: ${{steps.output-tags.outputs.tags}}
steps:
- uses: actions/github-script@v7
id: output-tags
with:
script: |
const tags = await github.paginate(
'GET /repos/{owner}/{repo}/tags', {
owner: 'thefrontside',
repo: 'effection',
},
(response) => response.data.filter(({ name }) => /effection-v3.0.0/.test(name))
);

core.setOutput('tags', JSON.stringify(tags.map(tag => tag.name)));
env:
GITHUB_TOKEN: ${{github.token}}

rebuild:
runs-on: ubuntu-latest
needs: setup
if: "join(fromJSON(needs.setup.outputs.tags), '') != ''"
strategy:
matrix:
tag: ${{fromJSON(needs.setup.outputs.tags)}}
max-parallel: 4

permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write

steps:
- uses: actions/checkout@v4
with:
ref: "refs/tags/${{ matrix.tag }}"

- name: setup deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Get Version
id: vars
run: echo ::set-output name=version::$(echo ${{ matrix.tag }} | sed 's/^effection-v//')

- name: Generate Docs for ${{ matrix.tag }}
run: deno doc --html --name=effection@$VERSION mod.ts
env:
VERSION: ${{steps.vars.outputs.version}}

- run: tar cfv docs.tar -C docs .

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: docs.tar
name: ${{steps.vars.outputs.version}}
tag_name: "refs/tags/${{ matrix.tag }}"
env:
GITHUB_TOKEN: ${{github.token}}
Loading