feat(release): add init container to statefulset #58
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
pull_request: | |
types: [closed] | |
branches: [main] | |
jobs: | |
build-artifacts: | |
env: | |
archive_name: artifact | |
strategy: | |
fail-fast: false | |
matrix: | |
pkg: [fuel-core-nats] | |
os: [ubuntu-latest] | |
target: [x86_64-unknown-linux-gnu] | |
runs-on: ${{ matrix.os }} | |
name: ${{ matrix.pkg }} ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: ./.github/actions/setup-rust | |
with: | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
- name: Install host target | |
run: rustup target add ${{ matrix.target }} | |
- name: Build | |
run: make build TARGET=${{ matrix.target }} PACKAGE=${{ matrix.pkg }} | |
- name: Set Archive Name | |
id: archive | |
run: echo "archive_name=${{ matrix.pkg }}-${{ matrix.target }}" >> $GITHUB_ENV | |
- name: Create Tar Archive | |
run: | | |
mkdir ${{ env.archive_name }} | |
cp target/${{ matrix.target }}/release/${{ matrix.pkg }} ${{ env.archive_name }} | |
tar -czf ${{ env.archive_name }}.tgz ${{ env.archive_name }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4.3.3 | |
with: | |
name: ${{ matrix.pkg }}-${{ matrix.target }} | |
path: ${{ env.archive_name }}.tgz | |
if-no-files-found: error | |
release: | |
needs: [build-artifacts] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
actions: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4.1.6 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
path: artifacts | |
merge-multiple: true | |
- name: List Artifacts | |
run: ls -R artifacts | |
- name: Cache Artifacts | |
uses: actions/cache@v4 | |
with: | |
path: artifacts | |
key: ${{ runner.os }}-artifacts-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-artifacts- | |
- name: Run Knope Action | |
uses: knope-dev/action@v2.1.0 | |
with: | |
github-token: ${{ secrets.REPO_TOKEN }} | |
- name: Knope Release | |
run: knope release | |
env: | |
github-token: ${{ secrets.REPO_TOKEN }} | |
publish-crates: | |
needs: [release] | |
if: github.event_name == 'release' && github.event.action == 'published' | |
runs-on: buildjet-4vcpu-ubuntu-2204 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Restore Artifacts Cache | |
uses: actions/cache@v4 | |
with: | |
path: artifacts | |
key: ${{ runner.os }}-artifacts-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-artifacts- | |
- name: Install Rust Toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
targets: wasm32-unknown-unknown | |
- name: Publish Crate | |
uses: FuelLabs/publish-crates@v1 | |
with: | |
publish-delay: 60000 | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} |