-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
57 lines (57 loc) · 1.78 KB
/
Copy pathaction.yml
File metadata and controls
57 lines (57 loc) · 1.78 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
name: Create and publish a crate tarball
author: Michał Górny
description: Create a Gentoo create tarball using pycargoebuild and attach it to a release
inputs:
tag:
description: Tag to create release on
default: ${{ github.ref_name }}
dist-filename:
description: The name of distribution file (e.g. foo-1.2.3-crates.tar.xz)
default: ${{ github.event.repository.name }}-${{ github.ref_name }}-crates.tar.xz
directories:
description: Directories with Cargo.toml files to process
default: .
run-cargo-update:
description: Run "cargo update" in top-level directory
default: false
runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Run cargo update
if: ${{ inputs.run-cargo-update == 'true' }}
shell: bash
run: cargo update
- name: Install pycargoebuild
shell: bash
run: pip install pycargoebuild
- name: Grab the license mapping
shell: bash
run: |
wget https://raw.githubusercontent.com/gentoo/gentoo/refs/heads/master/metadata/license-mapping.conf
- name: Cache fetched crates
uses: actions/cache@v6
with:
path: /tmp/dist
key: dist
- name: Create a dist tarball
shell: bash
run: |
pycargoebuild \
--crate-tarball \
--crate-tarball-path "${{ inputs.dist-filename }}" \
--distdir /tmp/dist \
--license-mapping license-mapping.conf \
${{ inputs.directories }}
- name: Create release
uses: softprops/action-gh-release@v3
with:
body:
files: ${{ inputs.dist-filename }}
tag_name: ${{ inputs.tag }}
fail_on_unmatched_files: true