Skip to content

CD

CD #56

Workflow file for this run

name: CD
on:
schedule:
- cron: "0 0 * * 3"
workflow_dispatch:
env:
TASK_X_REMOTE_TASKFILES: 1
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
secrets: inherit
release:
name: Release
needs: [ci]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
GH_TOKEN: ${{ github.token }}
run: |-
gh repo clone ${{ github.repository }} ${{ github.workspace }} -- --branch "$BRANCH"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Install tools
run: |
echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH"
/home/linuxbrew/.linuxbrew/bin/brew install \
commitizen \
go \
go-task \
goreleaser \
- name: Bump
run: |-
echo "PREVIOUS_REVISION=$(cz version --project)" >>"$GITHUB_ENV"
task bump --yes
echo "REVISION=$(cz version --project)" >>"$GITHUB_ENV"
- name: Push tags
if: env.PREVIOUS_REVISION != env.REVISION
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
REMOTE_REPO: https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git
run: git push "$REMOTE_REPO" "HEAD:${BRANCH}" --tags
- name: Release
if: env.PREVIOUS_REVISION != env.REVISION
env:
AUR_KEY: ${{ secrets.AUR_KEY }}
GITHUB_TOKEN: ${{ github.token }}
run: task release --yes