otherguy/alfred-passwords-workflow

View on GitHub
.github/workflows/release.yaml

Summary

Maintainability
Test Coverage
name: release

on:
  push:
    tags:
      - '*'

jobs:

  release:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version:
          - '3.8.9' # Monterey default
    steps:
      - name: 'Set up Python ${{ matrix.python-version }}'
        uses: actions/setup-python@v4.7.1
        with:
          python-version: '${{ matrix.python-version }}'
      - uses: actions/checkout@v4
      - run: python -m pip install --ignore-installed --target=lib -r requirements.txt
      - name: Extract tag name
        id: version
        run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
      - name: Print version
        run: echo ${{ steps.version.outputs.VERSION }}
      - name: Write version file
        run: echo ${{ steps.version.outputs.VERSION }} > version
      - name: Update info.plist
        run: perl -pi.bak -e "s/<string>(\d+\.\d+\.\d+)<\/string>/<string>${{ steps.version.outputs.VERSION }}<\/string>/ig" info.plist
      - name: Package Project
        run: zip -9 -r 'GenereratePasswords.alfredworkflow' . --exclude=*.venv* --exclude=*.git* --exclude=*.vscode* --exclude=*.github* --exclude=*__pycache__* --exclude=.codeclimate.yml
      - name: Add Release asset
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: 'GenereratePasswords.alfredworkflow'