Skip to content

refactor: Add LifeCycle #63

refactor: Add LifeCycle

refactor: Add LifeCycle #63

Workflow file for this run

name: Pipeline
on:
push:
branches:
- '*'
pull_request:
permissions:
contents: write
jobs:
check-conventional-commits:
uses: armakuni/github-actions/.github/workflows/check-conventional-commits.yml@v0.18.1
run-tests:
uses: ./.github/workflows/run-tests.yml
test-github-actions:
uses: ./.github/workflows/test-actions.yml
all-checks-passed:
runs-on: ubuntu-latest
needs:
- check-conventional-commits
- run-tests
- test-github-actions
steps:
- run: echo "OK"
shell: bash
bump-cargo-version:
runs-on: ubuntu-latest
needs:
- check-conventional-commits
if: github.ref == 'refs/heads/main' && needs.check-conventional-commits.outputs.will-bump == 'true'
steps:
- uses: tomphp/github-actions/checkout-rust-project@v0.2.0
- name: Strip version prefix
id: strip-version-prefix
shell: bash
run: echo "version=${VERSION#v}" >> "$GITHUB_OUTPUT"
env:
VERSION: ${{ needs.check-conventional-commits.outputs.bump-version }}
- name: Bump versions in files
uses: tomphp/versioned-files/github-actions/versioned-files@v0.4.2
with:
action: update
version: ${{ steps.strip-version-prefix.outputs.version }}
- name: Store updated files
uses: actions/upload-artifact@v3
with:
name: bumped-files
path: |
Cargo.*
README.md
build-binaries:
if: github.ref == 'refs/heads/main'
runs-on: ${{ matrix.os }}
needs:
- all-checks-passed
- bump-cargo-version
steps:
- uses: tomphp/github-actions/checkout-rust-project@v0.2.0
- uses: actions/download-artifact@v3
- run: mv bumped-files/Cargo.* .
shell: bash
- uses: tomphp/github-actions/determine-binary-name@v0.5.0
id: get-binary-name
with:
name: versioned-files
- name: Build release version
run: make "$BINARY_NAME"
env:
BINARY_NAME: ${{ steps.get-binary-name.outputs.name }}
shell: bash
- name: Move binary to upload location
env:
BINARY_NAME: ${{ steps.get-binary-name.outputs.name }}
BINARY_NAME_WITH_ARCH: ${{ steps.get-binary-name.outputs.name-with-arch }}
run: mv "$BINARY_NAME" "$BINARY_NAME_WITH_ARCH"
shell: bash
- uses: actions/upload-artifact@v3
name: Store built binary version
with:
name: bins
path: ${{ steps.get-binary-name.outputs.name-with-arch }}
strategy:
matrix:
include:
- os: macos-latest
- os: ubuntu-latest
- os: windows-latest
tag-and-release:
needs:
- build-binaries
uses: armakuni/github-actions/.github/workflows/tag-and-release.yml@v0.18.1
with:
download-artifacts: true
release-artifacts: ./bins/*