-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: split CI and Release, prerelease from rc/* branches
NB. Using "feat:" in the message to trigger version changes.
- Loading branch information
Showing
4 changed files
with
124 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- rc/* | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [linux] | ||
|
||
include: | ||
- os: linux | ||
runner: ubuntu-latest | ||
|
||
runs-on: ${{ matrix.runner }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: stack | ||
uses: freckle/stack-action@v5 | ||
- uses: freckle/weeder-action@v2 | ||
with: | ||
ghc-version: ${{ steps.stack.outputs.compiler-version }} | ||
- uses: extractions/setup-just@v2 | ||
- run: just dist | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.os }}-binaries | ||
path: "restyler-*.tar.gz" | ||
if-no-files-found: error | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
|
||
- id: token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.AUTOMATION_APP_ID }} | ||
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }} | ||
|
||
- id: release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ steps.token.outputs.token }} | ||
|
||
- if: ${{ steps.release.outputs.new_release_published == 'true' }} | ||
run: | | ||
gh release upload "$TAG" ./*-binaries/restyler-*.tar.gz | ||
env: | ||
TAG: ${{ steps.release.outputs.new_release_git_tag }} | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
docs: | ||
needs: [build] | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: gem install --user ronn-ng | ||
- run: | | ||
for bin in ~/.local/share/gem/ruby/*/bin; do | ||
echo "$bin" | ||
done >>"$GITHUB_PATH" | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: linux-binaries | ||
- run: | | ||
tar xzf restyler-*.tar.gz | ||
mkdir -p ./bin | ||
sudo mv -v restyler-*/restyle /usr/local/bin | ||
# TODO: only checkout doc folder | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate ronn documenation | ||
run: | | ||
restyle __render-docs-man1__ > doc/restyle.1.ronn | ||
restyle __render-docs-man5__ > doc/restyled.yaml.5.ronn | ||
- name: Generate HTML sources to _site | ||
run: | | ||
env \ | ||
RONN_STYLE=./doc \ | ||
RONN_ORGANIZATION=Restyled \ | ||
RONN_MANUAL="Restyler v$(restyle --version | cut -d' ' -f 2)" \ | ||
ronn --style toc,custom --roff --html doc/*.ronn | ||
mkdir -p _site/man-pages | ||
cp -v doc/*.html _site/man-pages/ | ||
- uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: _site | ||
- id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters