Skip to content

Commit

Permalink
Merge pull request #20 from gustawdaniel/2-publish-in-system-reposito…
Browse files Browse the repository at this point in the history
…ries

2 publish in system repositories
  • Loading branch information
gustawdaniel authored Mar 22, 2023
2 parents 779c450 + 8b90ff3 commit cbc8b23
Show file tree
Hide file tree
Showing 6 changed files with 417 additions and 110 deletions.
92 changes: 79 additions & 13 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,85 @@ on:
workflow_dispatch:

jobs:
build:
# snap:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install shunit
# run: sudo apt install -y shunit2
# - uses: snapcore/action-build@v1
# id: snapcraft
# - uses: actions/upload-artifact@v3
# with:
# name: snap
# path: ${{ steps.snapcraft.outputs.snap }}
# - run: |
# sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }} --classic
# - run: alias p=gpt-cli
# - run: ./test_version.sh
# debug:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install nFPM
# run: |
# echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
# sudo apt update
# sudo apt install -y nfpm shunit2 xorg-dev libxcb-composite0-dev
# - run: cargo build --release
# - run: nfpm pkg --packager deb --target target
# - run: sudo apt install ./target/gpt-cli_0.0.16_amd64.deb
# - run: ./test_version.sh
deb-rpm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install shunit
run: sudo apt install -y shunit2
- uses: snapcore/action-build@v1
id: snapcraft
- uses: actions/upload-artifact@v3
with:
name: snap
path: ${{ steps.snapcraft.outputs.snap }}
- run: |
sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }} --classic
- run: alias p=gpt-cli
- run: ./test_version.sh
- name: Install nFPM
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt update
sudo apt install -y nfpm shunit2 xorg-dev libxcb-composite0-dev
- run: cargo build --release
- name: Get release information
run: |
RELEASE_TAG=$(echo "v0.0.17" | sed "s|v||")
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Update fallback release URL
run: |
sed -i "s|version: .*|version: \"${{ env.RELEASE_TAG }}\"|" nfpm.yaml
# - name: Commit changes
# uses: EndBug/add-and-commit@v9
# with:
# author_name: Daniel Gustaw
# author_email: [email protected]
# message: "updated nfpm.yaml version to ${{ env.RELEASE_TAG }}"
# add: 'nfpm.yaml'
# push: origin HEAD:main
# tag_push: '--force'

- run: cat nfpm.yaml
- run: nfpm pkg --packager deb --target target
- run: ls -la target
- run: sudo apt install ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb
- run: ./test_version.sh
- run: nfpm pkg --packager rpm --target target
- run: nfpm pkg --packager archlinux --target target
- name: Compute shasums
run: |
mv ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb gpt-cli_amd64.deb
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}.x86_64.rpm gpt-cli.x86_64.rpm
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}-1-x86_64.pkg.tar.zst gpt-cli-x86_64.pkg.tar.zst
shasum -a 256 gpt-cli_amd64.deb | cut -d " " -f 1 > gpt-cli_amd64.deb.sha256.txt
shasum -a 256 gpt-cli.x86_64.rpm | cut -d " " -f 1 > gpt-cli.x86_64.rpm.sha256.txt
- run: ls -la
# - name: Release
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# with:
# files: |
# gpt-cli_amd64.deb
# gpt-cli.x86_64.rpm
# gpt-cli_amd64.deb.sha256.txt
# gpt-cli.x86_64.rpm.sha256.txt
# gpt-cli-x86_64.pkg.tar.zst
79 changes: 78 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
- name: Get release information
run: |
RELEASE_TAG=$(echo ${{ github.event.release.tag_name }} | sed "s|v||")
echo "Release tag: $RELEASE_TAG"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Use release information
run: |
Expand Down Expand Up @@ -148,3 +147,81 @@ jobs:
- run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

deb-rpm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install nFPM
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt update
sudo apt install -y nfpm shunit2 xorg-dev libxcb-composite0-dev
- run: cargo build --release
- name: Get release information
run: |
RELEASE_TAG=$(echo "v0.0.17" | sed "s|v||")
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Update fallback release URL
run: |
sed -i "s|version: .*|version: \"${{ env.RELEASE_TAG }}\"|" nfpm.yaml
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Daniel Gustaw
author_email: [email protected]
message: "updated nfpm.yaml version to ${{ env.RELEASE_TAG }}"
add: 'nfpm.yaml'
push: origin HEAD:main
tag_push: '--force'

- run: cat nfpm.yaml
- run: nfpm pkg --packager deb --target target
- run: ls -la target
- run: sudo apt install ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb
- run: ./test_version.sh
- run: nfpm pkg --packager rpm --target target
- run: nfpm pkg --packager archlinux --target target
- name: Compute shasums
run: |
mv ./target/gpt-cli_${{ env.RELEASE_TAG }}_amd64.deb gpt-cli_amd64.deb
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}.x86_64.rpm gpt-cli.x86_64.rpm
mv ./target/gpt-cli-${{ env.RELEASE_TAG }}-1-x86_64.pkg.tar.zst gpt-cli-x86_64.pkg.tar.zst
shasum -a 256 gpt-cli_amd64.deb | cut -d " " -f 1 > gpt-cli_amd64.deb.sha256.txt
shasum -a 256 gpt-cli.x86_64.rpm | cut -d " " -f 1 > gpt-cli.x86_64.rpm.sha256.txt
- run: ls -la
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
files: |
gpt-cli_amd64.deb
gpt-cli.x86_64.rpm
gpt-cli_amd64.deb.sha256.txt
gpt-cli.x86_64.rpm.sha256.txt
gpt-cli-x86_64.pkg.tar.zst
snap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install shunit
run: sudo apt install -y shunit2
- uses: snapcore/action-build@v1
id: snapcraft
- uses: actions/upload-artifact@v3
with:
name: snap
path: ${{ steps.snapcraft.outputs.snap }}
- run: |
sudo snap install --dangerous ${{ steps.snapcraft.outputs.snap }} --classic
- run: alias p=gpt-cli
- run: ./test_version.sh
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
files: |
${{ steps.snapcraft.outputs.snap }}
Loading

0 comments on commit cbc8b23

Please sign in to comment.