-
Notifications
You must be signed in to change notification settings - Fork 19
53 lines (42 loc) · 1.75 KB
/
create-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
43
44
45
46
47
48
49
50
51
52
53
name: Create and publish release
on:
pull_request:
types:
- closed
jobs:
create_release:
name: Create from merged release branch
uses: farcaster-project/workflows/.github/workflows/[email protected]
release_to_crates:
name: Publish the new release to crates.io
uses: farcaster-project/workflows/.github/workflows/[email protected]
# Do not run before creating the release is done
needs: create_release
secrets:
cratesio_token: ${{ secrets.H4SH3D_CARGO_REGISTRY_TOKEN }}
faracsterd_image:
name: Farcasterd Docker image
runs-on: ubuntu-latest
# Do not run before creating the release is done
needs: create_release
steps:
- uses: actions/checkout@v3
- name: Extract version from branch name
id: extract-version
shell: python
run: |
branch_name = "${{ github.event.pull_request.head.ref }}"
version = branch_name.split("/")[1]
print(f"::set-output name=version::{version}")
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build
run: docker build -f $GITHUB_WORKSPACE/Dockerfile -t ghcr.io/farcaster-project/farcaster-node/farcasterd:${{ steps.extract-version.outputs.version }} -t ghcr.io/farcaster-project/farcaster-node/farcasterd:latest $GITHUB_WORKSPACE
- name: Docker push to GitHub Packages (latest)
run: docker push ghcr.io/farcaster-project/farcaster-node/farcasterd:latest
- name: Docker push to GitHub Packages (release)
run: docker push ghcr.io/farcaster-project/farcaster-node/farcasterd:${{ steps.extract-version.outputs.version }}