Skip to content

Commit

Permalink
prettified workflow all files
Browse files Browse the repository at this point in the history
  • Loading branch information
ZibanPirate committed Nov 21, 2024
1 parent d70725c commit e3f5aea
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 99 deletions.
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ rust:

c:
- changed-files:
- any-glob-to-any-file: "c/**"
- any-glob-to-any-file: "c/**"

d:
- changed-files:
- any-glob-to-any-file: "d/**"
- any-glob-to-any-file: "d/**"
4 changes: 2 additions & 2 deletions .github/workflows/c-gen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- name: Build docs with Doxygen
uses: mattnotmitt/doxygen-action@v1.9.5
with:
working-directory: 'c/'
doxyfile-path: 'Doxyfile'
working-directory: "c/"
doxyfile-path: "Doxyfile"

- name: Publish to GitHub Pages
if: success()
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/c-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Release tag (.eg v1.0.0)'
description: "Release tag (.eg v1.0.0)"
required: true
type: string

Expand Down Expand Up @@ -51,15 +51,15 @@ jobs:
- name: Create archive
uses: TheDoctor0/zip-release@0.7.6
with:
type: 'tar'
filename: 'github-release/c-release.tar.gz'
directory: 'c'
exclusions: './build/* github-release'
type: "tar"
filename: "github-release/c-release.tar.gz"
directory: "c"
exclusions: "./build/* github-release"

- name: Upload release
uses: ncipollo/release-action@v1.14.0
with:
name: 'Kuliya latest'
artifacts: 'c/github-release/c-release.tar.gz'
tag: 'c-${{ inputs.tag }}'
name: "Kuliya latest"
artifacts: "c/github-release/c-release.tar.gz"
tag: "c-${{ inputs.tag }}"
token: ${{ secrets.GITHUB_TOKEN }}
142 changes: 71 additions & 71 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,77 @@ name: "Draft New Release"
run-name: "Draft: ${{ github.event.inputs.project }}-${{ github.event.inputs.version }}"

on:
workflow_dispatch:
inputs:
project:
type: choice
options:
- "c"
- "csharp"
- "d"
- "java"
- "javascript"
- "php"
- "python"
- "rust"
required: true
version:
description: "eg. 0.1.0"
required: true
workflow_dispatch:
inputs:
project:
type: choice
options:
- "c"
- "csharp"
- "d"
- "java"
- "javascript"
- "php"
- "python"
- "rust"
required: true
version:
description: "eg. 0.1.0"
required: true

jobs:
apply-version-rust:
name: "Apply Version for: ${{ github.event.inputs.project }}"
runs-on: ubuntu-latest
if: ${{ github.event.inputs.project == 'rust' }}
env:
CWD: "./${{ github.event.inputs.project }}"
PROJECT: ${{ github.event.inputs.project }}
PUBLISH_VERSION: ${{ github.event.inputs.version }}
BRANCH: "main"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo install cargo-bump
working-directory: ${{ env.CWD }}
- run: cargo bump ${{ env.PUBLISH_VERSION }}
working-directory: ${{ env.CWD }}
- run: cargo build
working-directory: ${{ env.CWD }}
- name: "Commit and Push"
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git checkout ${{ env.BRANCH }}
git add .
git commit -m "$PROJECT$PUBLISH_VERSION"
git push origin HEAD:refs/heads/${{ env.BRANCH }}
apply-version-rust:
name: "Apply Version for: ${{ github.event.inputs.project }}"
runs-on: ubuntu-latest
if: ${{ github.event.inputs.project == 'rust' }}
env:
CWD: "./${{ github.event.inputs.project }}"
PROJECT: ${{ github.event.inputs.project }}
PUBLISH_VERSION: ${{ github.event.inputs.version }}
BRANCH: "main"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo install cargo-bump
working-directory: ${{ env.CWD }}
- run: cargo bump ${{ env.PUBLISH_VERSION }}
working-directory: ${{ env.CWD }}
- run: cargo build
working-directory: ${{ env.CWD }}
- name: "Commit and Push"
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git checkout ${{ env.BRANCH }}
git add .
git commit -m "$PROJECT$PUBLISH_VERSION"
git push origin HEAD:refs/heads/${{ env.BRANCH }}
draft-github-release:
name: "Draft GitHub Release"
runs-on: ubuntu-latest
needs: [apply-version-rust]
permissions:
contents: write
env:
PROJECT: ${{ github.event.inputs.project }}
PUBLISH_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: "main"
steps:
- name: "Create Release"
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ env.PROJECT }}-${{ env.PUBLISH_VERSION }}",
"target_commitish": "${{ env.BRANCH }}",
"name": "${{ env.PROJECT }}-${{ env.PUBLISH_VERSION }}",
"body": "",
"draft": true,
"prerelease": false
}' \
https://api.github.com/repos/${{ github.repository }}/releases
draft-github-release:
name: "Draft GitHub Release"
runs-on: ubuntu-latest
needs: [apply-version-rust]
permissions:
contents: write
env:
PROJECT: ${{ github.event.inputs.project }}
PUBLISH_VERSION: ${{ github.event.inputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: "main"
steps:
- name: "Create Release"
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ env.PROJECT }}-${{ env.PUBLISH_VERSION }}",
"target_commitish": "${{ env.BRANCH }}",
"name": "${{ env.PROJECT }}-${{ env.PUBLISH_VERSION }}",
"body": "",
"draft": true,
"prerelease": false
}' \
https://api.github.com/repos/${{ github.repository }}/releases
32 changes: 16 additions & 16 deletions .github/workflows/rust-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ name: "CD"
run-name: "Publish: ${{ github.ref_name }}"

on:
push:
tags:
- "rust-*"
push:
tags:
- "rust-*"

jobs:
publish:
name: cargo publish
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CWD: "rust"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo publish
working-directory: ${{ env.CWD }}
publish:
name: cargo publish
runs-on: ubuntu-latest
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CWD: "rust"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo publish
working-directory: ${{ env.CWD }}

0 comments on commit e3f5aea

Please sign in to comment.