release.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: Release
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. releaseVersion:
  6. description: The release version for which to build and upload artifacts
  7. required: true
  8. type: string
  9. release:
  10. types: [ published ]
  11. jobs:
  12. build:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v3
  16. - name: Extract release version when job started by release being published
  17. run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
  18. if: ${{ github.event_name == 'release' }}
  19. - name: Extract release version when job manually started
  20. run: echo "RELEASE_VERSION=${{ inputs.releaseVersion }}" >> $GITHUB_ENV
  21. if: ${{ github.event_name == 'workflow_dispatch' }}
  22. - name: Build the plugins
  23. run: |
  24. swift build --configuration=release --product protoc-gen-swift
  25. cp ./.build/release/protoc-gen-swift .
  26. swift build --configuration=release --product protoc-gen-grpc-swift
  27. cp ./.build/release/protoc-gen-grpc-swift .
  28. - name: Zip the plugins
  29. run: |
  30. zip protoc-grpc-swift-plugins-linux-x86_64-${{ env.RELEASE_VERSION }}.zip protoc-gen-swift protoc-gen-grpc-swift
  31. - name: Upload artifacts
  32. uses: softprops/action-gh-release@v1
  33. with:
  34. files: protoc-grpc-swift-plugins-linux-x86_64-${{ env.RELEASE_VERSION }}.zip