Skip to content

Commit

Permalink
Release 0.3.1
Browse files Browse the repository at this point in the history
st8ed committed Jun 15, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 170f3a7 commit c342b84
Showing 2 changed files with 15 additions and 22 deletions.
29 changes: 10 additions & 19 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ jobs:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

- name: Build
- run: |
run: |
nix build .#package
echo "PACKAGE_PATH=$(readlink -f result)" >>$GITHUB_ENV
@@ -47,7 +47,6 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
packages: write # For GitHub Container Registry
contents: write # For GitHub Releases
steps:
- uses: actions/download-artifact@v3
@@ -81,9 +80,13 @@ jobs:
- name: Package release
run: |
tar cf ./dist/aws-exporter-$VERSION.linux-amd64.tar.gz \
tar cf ./dist/aws-cost-exporter-$VERSION.linux-amd64.tar.gz \
-C ./dist/release .
chart=$(find ./dist/chart -type f | grep -o 'aws-cost-exporter-.*\.tgz')
echo "chart=$chart"
mv -v ./dist/chart/*.tgz ./dist/$chart
- name: Load image
run: |
docker load -i ./dist/image/*.tar.gz
@@ -95,29 +98,17 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push image
run:
run: |
docker push $IMAGE_REPOSITORY:$VERSION
docker push $IMAGE_REPOSITORY:$VERSION $IMAGE_REPOSITORY:latest

docker push $IMAGE_REPOSITORY:$VERSION \
ghcr.io/$IMAGE_REPOSITORY:$VERSION
docker push $IMAGE_REPOSITORY:$VERSION \
ghcr.io/$IMAGE_REPOSITORY:latest
docker push $IMAGE_REPOSITORY:latest
- name: Create release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
name: Release ${{ env.VERSION }}
files: |
./dist/aws-exporter-*.tar.gz
./dist/chart/*.tgz
./dist/aws-cost-exporter-*.tar.gz
./dist/aws-cost-exporter-chart-*.tgz
fail_on_unmatched_files: true
generate_release_notes: true
8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -4,18 +4,18 @@
version = "0.3.1";
chartVersion = "0.1.2";
vendorSha256 = "sha256-LZomE9j6m7TAPyY/sZWVupyh8mkt8MjwUnmbYzZoUP8=";
dockerPackageTag = "ghcr.io/st8ed/aws-cost-exporter:${version}";
dockerPackageTag = "st8ed/aws-cost-exporter:${version}";

src = with lib; builtins.path {
name = "aws-cost-exporter-src";
path = sources.cleanSourceWith {
path = sources.cleanSourceWith rec {
filter = name: type:
let baseName = baseNameOf (toString name); in
!(
(baseName == ".github") ||
(hasSuffix ".nix" baseName) ||
(hasSuffix ".md" baseName) ||
(hasPrefix "${./.}/chart/" name)
(hasPrefix "${src}/chart" name)
);
src = lib.cleanSource ./.;
};
@@ -142,6 +142,8 @@
package = nixpkgsFor."${system}".aws-cost-exporter;
dockerImage = nixpkgsFor."${system}".aws-cost-exporter-dockerImage;
helmChart = nixpkgsFor."${system}".aws-cost-exporter-helmChart;

inherit src src-chart;
});
};
}

0 comments on commit c342b84

Please sign in to comment.