This repository was archived by the owner on Nov 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
131 lines (119 loc) · 3.8 KB
/
Copy pathrelease.yaml
File metadata and controls
131 lines (119 loc) · 3.8 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
jobs:
create-gh-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: taiki-e/create-gh-release-action@v1
with:
# (Optional) Path to changelog.
changelog: CHANGELOG.md
# (Optional) Reject releases from commits not contained in branches
# that match the specified pattern (regular expression)
branch: main
# (Required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
upload-gh-assets:
needs: create-gh-release
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: taiki-e/upload-rust-binary-action@v1
with:
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
# Note that glob pattern is not supported yet.
bin: pq
# (optional) On which platform to distribute the `.tar.gz` file.
# [default value: unix]
# [possible values: all, unix, windows, none]
tar: unix
# (optional) On which platform to distribute the `.zip` file.
# [default value: windows]
# [possible values: all, unix, windows, none]
zip: windows
# (required) GitHub token for uploading assets to GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}
publish-to-crates-io:
needs: create-gh-release
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v3
- uses: actions-rs/cargo@v1
with:
command: publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
publish-gh-package:
needs: publish-to-crates-io
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
brew-dispatcher:
name: Release on homebrew-prql
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.HOMEBREW_PRQL_TOKEN}}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'prql',
repo: 'homebrew-prql',
workflow_id: 'update-prql-query.yaml',
ref: 'main',
inputs: {
version: '${{ github.ref }}',
URL: 'https://github.com/prql/prql-query/archive/${{ github.ref }}.tar.gz'
}
})
build-and-publish-snap:
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v4
- name: 📦 Build Snap
id: build
uses: snapcore/action-build@v1
#- name: 🆙 Publish Snap
# uses: snapcore/action-publish@v1
# env:
# SNAPCRAFT_STORE_CREDENTIALS:
# ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
# with:
# snap: ${{ steps.build.outputs.snap }}
# release: edge