-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (44 loc) · 1.95 KB
/
cd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: CD
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch: # Run with Run Workflow button in GitHub Action Job, set debug_enabled=true for interactive ssh session.
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
generate-cd-inputs:
runs-on: ubuntu-latest
outputs:
description: ${{ steps.set-outputs.outputs.description }}
homepage: ${{ steps.set-outputs.outputs.homepage }}
maintainer: ${{ steps.set-outputs.outputs.maintainer }}
project-name: ${{ steps.set-outputs.outputs.project-name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set outputs
id: set-outputs
run: |
set -eu pipefail
echo "::set-output name=description::$(grep ^description Cargo.toml | cut -d'=' -f2 | sed -e 's/\s*//' -e 's/\"//g')"
echo "::set-output name=homepage::$(grep ^repository Cargo.toml | cut -d'=' -f2 | sed -e 's/\s*//' -e 's/\"//g')"
echo "::set-output name=maintainer::$(grep ^authors Cargo.toml | cut -d'=' -f2 | sed -e 's/[][]//g' -e 's/\s*//' -e 's/\"//g')"
echo "::set-output name=project-name::$(grep ^name Cargo.toml | cut -d'=' -f2 | sed -e 's/\s*//' -e 's/\"//g')"
cd:
uses: mihaigalos/workflows/.github/workflows/rust-cd.yaml@main
needs:
- generate-cd-inputs
with:
COPYRIGHT_YEARS: 2021-3021
DESCRIPTION: ${{ needs.generate-cd-inputs.outputs.description }}
HOMEPAGE: ${{ needs.generate-cd-inputs.outputs.homepage }}
MAINTAINER: ${{ needs.generate-cd-inputs.outputs.maintainer }}
PROJECT_NAME: ${{ needs.generate-cd-inputs.outputs.project-name }}
secrets:
CARGO_API_KEY: ${{ secrets.CARGO_API_KEY }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}