This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
Update copyright year in LICENSE file(s) (#229) #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
timeout-minutes: 4 | |
runs-on: ubuntu-latest | |
name: ${{ matrix.package }} publishing | |
strategy: | |
matrix: | |
package: | |
- 'wakelock' | |
- 'wakelock_macos' | |
- 'wakelock_platform_interface' | |
- 'wakelock_web' | |
- 'wakelock_windows' | |
fail-fast: false | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 2 | |
- name: Check package Pubspec | |
id: pubspec | |
run: | | |
set +e | |
git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep '${{ matrix.package }}/pubspec.yaml' &> /dev/null | |
echo ::set-output name=changed::$? | |
set -e | |
- name: Extract package version | |
if: steps.pubspec.outputs.changed == 0 | |
run: | | |
cd ${{ matrix.package }} | |
echo "VERSION=$(awk '{if ($1 ~ /^version:/) print $2}' pubspec.yaml)" >> $GITHUB_ENV | |
- uses: sakebook/[email protected] | |
if: steps.pubspec.outputs.changed == 0 | |
with: | |
package_directory: ${{ matrix.package }} | |
credential: ${{ secrets.PUB_CREDENTIALS }} | |
flutter_package: true | |
skip_test: true | |
- name: Create Release | |
if: steps.pubspec.outputs.changed == 0 | |
id: create_release | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ matrix.package }}-v${{ env.VERSION }} | |
release_name: ${{ matrix.package }} v${{ env.VERSION }} | |
draft: false | |
prerelease: false |