• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Release
2
3permissions:
4  # TODO: once `releases: write` is supported, use it instead.
5  contents: write
6
7on:
8  push:
9    tags:
10      - v[0-9]+.*
11
12env:
13  CARGO_INCREMENTAL: 0
14  CARGO_NET_RETRY: 10
15  CARGO_TERM_COLOR: always
16  RUST_BACKTRACE: full
17  RUSTFLAGS: -D warnings
18  RUSTUP_MAX_RETRIES: 10
19
20defaults:
21  run:
22    shell: bash
23
24jobs:
25  create-release:
26    if: github.repository_owner == 'taiki-e'
27    runs-on: ubuntu-latest
28    steps:
29      - uses: actions/checkout@v3
30        with:
31          persist-credentials: false
32      - uses: taiki-e/github-actions/install-rust@main
33        with:
34          toolchain: stable
35      - run: cargo package
36      - uses: taiki-e/create-gh-release-action@v1
37        with:
38          changelog: CHANGELOG.md
39          title: $version
40          branch: main
41        env:
42          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43      - run: cargo publish
44        env:
45          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
46