-
Notifications
You must be signed in to change notification settings - Fork 419
42 lines (34 loc) · 1.35 KB
/
release.yml
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
name: Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: The release version for which to build and upload artifacts
required: true
type: string
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract release version when job started by release being published
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
if: ${{ github.event_name == 'release' }}
- name: Extract release version when job manually started
run: echo "RELEASE_VERSION=${{ inputs.releaseVersion }}" >> $GITHUB_ENV
if: ${{ github.event_name == 'workflow_dispatch' }}
- name: Build the plugins
run: |
swift build --configuration=release --product protoc-gen-swift
cp ./.build/release/protoc-gen-swift .
swift build --configuration=release --product protoc-gen-grpc-swift
cp ./.build/release/protoc-gen-grpc-swift .
- name: Zip the plugins
run: |
zip protoc-grpc-swift-plugins-linux-x86_64-${{ env.RELEASE_VERSION }}.zip protoc-gen-swift protoc-gen-grpc-swift
- name: Upload artifacts
uses: softprops/action-gh-release@v1
with:
files: protoc-grpc-swift-plugins-linux-x86_64-${{ env.RELEASE_VERSION }}.zip