You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rulebot/.gitea/workflows/publish_package.yaml

65 lines
2.0 KiB
YAML

1 year ago
name: Publish Cargo package
run-name: ${{ github.actor }} is building ${{ github.repository }}
1 year ago
on:
push:
1 year ago
tags:
1 year ago
- 'v[0-9]+.[0-9]+.[0-9]+'
1 year ago
1 year ago
jobs:
Publish-Cargo:
runs-on: ubuntu-latest
steps:
1 year ago
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }}."
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
1 year ago
- name: Install minimal Rust
1 year ago
uses: https://github.com/actions-rs/toolchain@v1
1 year ago
with:
1 year ago
toolchain: stable
1 year ago
profile: minimal
1 year ago
1 year ago
- name: Check out repository code
uses: actions/checkout@v3
1 year ago
1 year ago
- name: Publish
1 year ago
uses: https://github.com/actions-rs/cargo@v1
1 year ago
with:
1 year ago
command: publish
1 year ago
args: --index=https://git.raptorpond.com/henine/_cargo-index.git --token "Bearer ${{ secrets.PACKAGE_TOKEN }}"
1 year ago
Publish-Docker:
runs-on: ubuntu-latest
needs: [Publish-Cargo]
steps:
- name: Check out repository code
uses: https://github.com/actions/checkout@v3
1 year ago
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Install Docker
run: curl -fsSL https://get.docker.com | sh
1 year ago
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v2
1 year ago
- name: Login to registry
uses: docker/login-action@v2
with:
registry: git.raptorpond.com
username: henine
password: "${{ secrets.PACKAGE_TOKEN }}"
- name: Build and push
uses: https://github.com/docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags:
- git.raptorpond.com/${{ github.repository }}:latest
- git.raptorpond.com/${{ github.repository }}:${{ env.VERSION }}