Skip to content

Commit

Permalink
chore: prettify codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Sep 28, 2022
1 parent de09c01 commit 2a0ed02
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 76 deletions.
152 changes: 77 additions & 75 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,95 @@
name: Build

on:
push:
tags:
- '*'
push:
tags:
- "*"

jobs:
dependencies:
name: Build dependencies
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
dependencies:
name: Build dependencies
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}

steps:
- name: Check out source files
uses: actions/checkout@v3
steps:
- name: Check out source files
uses: actions/checkout@v3

- name: Create global variables
id: version
run: echo "::set-output name=version::$(git rev-parse --short HEAD)"
- name: Create global variables
id: version
run: echo "::set-output name=version::$(git rev-parse --short HEAD)"

build:
name: Build PDF files
runs-on: ubuntu-latest
needs: dependencies
build:
name: Build PDF files
runs-on: ubuntu-latest
needs: dependencies

steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out source files
uses: actions/checkout@v3
- name: Check out source files
uses: actions/checkout@v3

- name: Create global variables
id: version
run: echo "::set-output name=version::$(git rev-parse --short HEAD)"
- name: Create global variables
id: version
run: echo "::set-output name=version::$(git rev-parse --short HEAD)"

- name: Install Nix
uses: cachix/install-nix-action@v17
- name: Install Nix
uses: cachix/install-nix-action@v17

- name: Build document
run: |
nix build .#pdf --quiet
cp result documentation.pdf
- name: Build document
run: |
nix build .#pdf --quiet
cp result documentation.pdf
- name: Upload build assets
uses: actions/upload-artifact@v3
with:
name: assets
path: documentation.pdf
- name: Upload build assets
uses: actions/upload-artifact@v3
with:
name: assets
path: documentation.pdf

release:
name: "Create tag/pre-release"
runs-on: ubuntu-latest
needs: [dependencies,build]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create pre-release (${{ needs.dependencies.outputs.version }})
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}-${{ needs.dependencies.outputs.version }}
release_name: Version ${{ github.run_number }} (${{ needs.dependencies.outputs.version }})
draft: false
prerelease: true
release:
name: "Create tag/pre-release"
runs-on: ubuntu-latest
needs: [dependencies, build]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create pre-release (${{ needs.dependencies.outputs.version }})
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}-${{ needs.dependencies.outputs.version }}
release_name: Version ${{ github.run_number }} (${{ needs.dependencies.outputs.version }})
draft: false
prerelease: true

assets:
name: Upload release assets
runs-on: ubuntu-latest
needs: [dependencies,release]
assets:
name: Upload release assets
runs-on: ubuntu-latest
needs: [dependencies, release]

steps:
- name: Download build assets (${{ matrix.assets.input }})
uses: actions/download-artifact@v3
with:
name: assets
path: assets
steps:
- name: Download build assets (${{ matrix.assets.input }})
uses: actions/download-artifact@v3
with:
name: assets
path: assets

- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: assets/documentation.pdf
asset_name: loophp-collection-documentation--version-${{ github.ref_name }}--${{ needs.dependencies.outputs.version }}.pdf
asset_content_type: application/pdf
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: assets/documentation.pdf
asset_name:
loophp-collection-documentation--version-${{ github.ref_name }}--${{
needs.dependencies.outputs.version }}.pdf
asset_content_type: application/pdf
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ See [CHANGELOG.md][43] for a changelog based on [git commits][44].

For more detailed changelogs, please check [the release changelogs][45].

[phpsandbox image]: https://img.shields.io/badge/Try%20it-online%20!-brightgreen?style=flat-square
[phpsandbox image]:
https://img.shields.io/badge/Try%20it-online%20!-brightgreen?style=flat-square
[phpsandbox link]: https://play.phpsandbox.io/loophp/collection
[packagist link]: https://packagist.org/packages/loophp/collection
[github actions link]: https://github.com/loophp/collection/actions
Expand Down

0 comments on commit 2a0ed02

Please sign in to comment.