-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (60 loc) · 1.84 KB
/
release.yml
File metadata and controls
63 lines (60 loc) · 1.84 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release
on:
push:
tags: # Sequence of patterns matched against refs/tags
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
outputs:
artifact_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false
artifacts:
needs: [ release ]
name: Build Artifacts
strategy:
matrix:
include:
- target: linux
arch: amd64
os: ubuntu-latest
- target: freebsd
arch: amd64
os: ubuntu-latest
- target: darwin
arch: amd64
os: macos-latest
- target: darwin
arch: arm64
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build
env:
GOOS: ${{ matrix.target }}
GOARCH: ${{ matrix.arch }}
run: |
make archive GITHASH=${{ github.sha }}
- name: Upload artifact
id: upload_artifact_linux_amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.artifact_upload_url }}
asset_path: ./target/${{ matrix.target }}_${{ matrix.arch }}/urlenc-${{ github.sha }}-${{ matrix.target }}-${{ matrix.arch }}.tgz
asset_name: urlenc-${{ github.ref_name }}-${{ matrix.target }}-${{ matrix.arch }}.tgz
asset_content_type: application/x-tgz